Skip to contentSkip to conversation

git-rebase.txt: rewrite docu for fixup/squash (again)

PATCH RESEND Superseded Oswald Buddenhagen 5 participants 17 messages Oct 23, 2023 – Oct 31, 2023 Documentation

lore
Share & tools
lore
#0 lore raw

PATCH RESEND v2 1/1 git-rebase.txt: rewrite docu for fixup/squash (again)

Create a clear top-down structure which makes it hopefully unambiguous what happens when.

Also mention the timestamp along with the author - this is primarily meant to include the keywords somebody might be searching for, like I did a year ago.

---
v2:
- slight adjustments inspired by marc. however, i left most things unchanged or even went in the opposite direction, because i assume the readers to be sufficiently context-sensitive, and the objective is merely to be not actively confusing. adding redundancy in the name of clarity would just make the text stylistically inferior and arguably harder to read.

Cc Junio C Hamano <[email protected]>
Cc Phillip Wood <[email protected]>
Cc Christian Couder <[email protected]>
Cc Charvi Mendiratta <[email protected]>
Cc Marc Branchaud <[email protected]>
---
 Documentation/git-rebase.txt | 29 +++++++++++++++--------------
 1 file changed, 15 insertions(+), 14 deletions(-)
Documentation/git-rebase.txt +15 -14
index e7b39ad244..337df9ef2f 100644
@@ -890,20 +890,21 @@ command "pick" with the command "reword".
 To drop a commit, replace the command "pick" with "drop", or just
 delete the matching line.
 
-If you want to fold two or more commits into one, replace the command
-"pick" for the second and subsequent commits with "squash" or "fixup".
-If the commits had different authors, the folded commit will be
-attributed to the author of the first commit.  The suggested commit
-message for the folded commit is the concatenation of the first
-commit's message with those identified by "squash" commands, omitting the
-messages of commits identified by "fixup" commands, unless "fixup -c"
-is used.  In that case the suggested commit message is only the message
-of the "fixup -c" commit, and an editor is opened allowing you to edit
-the message.  The contents (patch) of the "fixup -c" commit are still
-incorporated into the folded commit. If there is more than one "fixup -c"
-commit, the message from the final one is used.  You can also use
-"fixup -C" to get the same behavior as "fixup -c" except without opening
-an editor.
+If you want to fold two or more commits into one (that is, to combine
+their contents/patches), replace the command "pick" for the second and
+subsequent commits with "squash" or "fixup".
+The commit message for the folded commit is the concatenation of the
+message of the first commit with those of commits identified by "squash"
+commands, omitting those of commits identified by "fixup" commands,
+unless "fixup -c" is used. In the latter case, the message is obtained
+only from the "fixup -c" commit (having more than one of these is
+incorrect).
+If the resulting commit message is a concatenation of multiple messages,
+an editor is opened allowing you to edit it. This is also the case for a
+message obtained via "fixup -c", while using "fixup -C" instead skips
+the editor; this is analogous to the behavior of `git commit`.
+The first commit which contributes to the suggested commit message also
+determines the author, along with the date/timestamp.
 
 `git rebase` will stop when "pick" has been replaced with "edit" or
 when a command fails due to merge errors. When you are done editing
Signature · 1 line
2.42.0.419.g70bf8a5751
#1 lore raw

Hi Oswald

Quoted 21 lines · Oswald Buddenhagen
Documentation/git-rebase.txt +0 -13
index e7b39ad244..337df9ef2f 100644
@@ -890,20 +890,21 @@ command "pick" with the command "reword".
  To drop a commit, replace the command "pick" with "drop", or just
  delete the matching line.
 
-If you want to fold two or more commits into one, replace the command
-"pick" for the second and subsequent commits with "squash" or "fixup".
-If the commits had different authors, the folded commit will be
-attributed to the author of the first commit.  The suggested commit
-message for the folded commit is the concatenation of the first
-commit's message with those identified by "squash" commands, omitting the
-messages of commits identified by "fixup" commands, unless "fixup -c"
-is used.  In that case the suggested commit message is only the message
-of the "fixup -c" commit, and an editor is opened allowing you to edit
-the message.  The contents (patch) of the "fixup -c" commit are still
-incorporated into the folded commit. If there is more than one "fixup -c"
-commit, the message from the final one is used.  You can also use
-"fixup -C" to get the same behavior as "fixup -c" except without opening

Documentation/git-rebase.txt command "pick" with the command "reword". · line 901

Quoted 10 lines
Documentation/git-rebase.txt +9 -1
-an editor.
+If you want to fold two or more commits into one (that is, to combine
+their contents/patches), replace the command "pick" for the second and
+subsequent commits with "squash" or "fixup".
+The commit message for the folded commit is the concatenation of the
+message of the first commit with those of commits identified by "squash"
+commands, omitting those of commits identified by "fixup" commands,
+unless "fixup -c" is used. In the latter case, the message is obtained
+only from the "fixup -c" commit (having more than one of these is
+incorrect).

This change is incorrect - it is perfectly fine to have more than one "fixup -c" command. In that case we use the message of the commit of the final "fixup -c" command. One case where there can be multiple "fixup -c" commands is when a commit has been reworded several times via "git commit --fixup=reword:<commit>" and the user runs "git rebase --autosquash"

Documentation/git-rebase.txt command "pick" with the command "reword". · line 907

Quoted 6 lines
Documentation/git-rebase.txt +6 -0
+If the resulting commit message is a concatenation of multiple messages,
+an editor is opened allowing you to edit it. This is also the case for a
+message obtained via "fixup -c", while using "fixup -C" instead skips
+the editor; this is analogous to the behavior of `git commit`.
+The first commit which contributes to the suggested commit message also
+determines the author, along with the date/timestamp.

In the case of

pick A
fixup -C B

don't we keep the authorship from A and just use the commit message from B?

Best Wishes

Phillip

#2 lore raw
Quoted 8 lines · Phillip Wood

Documentation/git-rebase.txt command "pick" with the command "reword". · line 901

Quoted 4 lines · Oswald Buddenhagen

+unless "fixup -c" is used. In the latter case, the message is obtained

Documentation/git-rebase.txt +2 -0
+only from the "fixup -c" commit (having more than one of these is
+incorrect).

This change is incorrect - it is perfectly fine to have more than one "fixup -c" command. In that case we use the message of the commit of the final "fixup -c" command.

i know that this is the case, see the previous thread (which i failed to link by header, cf. https://lore.kernel.org/all/[email protected]/T/#u ).

Quoted 3 lines

One case where there can be multiple "fixup -c" commands is when a commit has been reworded several times via "git commit --fixup=reword:<commit>" and the user runs "git rebase --autosquash"

a cleaner solution would be recognizing the situation and not generating these contradicting commands in the first place. of course that would be more complexity, but it would also allow catching accidental use.

of course i can go back to documenting the status quo, but it seems kind of wrong.

Quoted 7 lines

In the case of

pick A
fixup -C B

don't we keep the authorship from A and just use the commit message from B?

uhm. we clearly do. that means i was given incorrect advice in https://lore.kernel.org/all/YjXRM5HiRizZ035p@ugly/T/#u (and so the thread is still looking for a resolution) ...

regards

#3 lore raw

Hi Oswald

Quoted 9 lines · Oswald Buddenhagen
Quoted 7 lines · Phillip Wood

Documentation/git-rebase.txt command "pick" with the command "reword". · line 901

Quoted 3 lines · Oswald Buddenhagen
Documentation/git-rebase.txt +3 -0
+unless "fixup -c" is used. In the latter case, the message is obtained
+only from the "fixup -c" commit (having more than one of these is
+incorrect).

This change is incorrect - it is perfectly fine to have more than one "fixup -c" command. In that case we use the message of the commit of the final "fixup -c" command.

i know that this is the case, see the previous thread (which i failed to link by header, cf. https://lore.kernel.org/all/[email protected]/T/#u ).

Ah, I see Marc has already raised this point.

Quoted 6 lines
Quoted 3 lines

One case where there can be multiple "fixup -c" commands is  when a commit has been reworded several times via "git commit --fixup=reword:<commit>" and the user runs "git rebase --autosquash"

a cleaner solution would be recognizing the situation and not generating these contradicting commands in the first place. of course that would be more complexity, but it would also allow catching accidental use.

of course i can go back to documenting the status quo, but it seems kind of wrong.

I agree there is an argument for improving the implementation of --autosquash but until we do I think it is counterproductive to change the documentation like this as it will cause users to wonder why "rebase --autosquash" generates a todo list that is incorrect according to the documentation.

Quoted 8 lines
Quoted 7 lines

In the case of

pick A
fixup -C B

don't we keep the authorship from A and just use the commit message from B?

uhm. we clearly do. that means i was given incorrect advice in https://lore.kernel.org/all/YjXRM5HiRizZ035p@ugly/T/#u (and so the thread is still looking for a resolution) ...

I'll take a look at that thread and comment there.

I do think it is a good idea to document where the authorship of a rebased commit comes from.

Best Wishes

Phillip

#4 lore raw
Quoted 5 lines · Phillip Wood

I agree there is an argument for improving the implementation of --autosquash but until we do I think it is counterproductive to change the documentation like this as it will cause users to wonder why "rebase --autosquash" generates a todo list that is incorrect according to the documentation.

That's a good point.

Quoted 2 lines

I do think it is a good idea to document where the authorship of a rebased commit comes from.

Yeah, sounds like a good idea. As to the authorship information, it might be nicer if the "rebase -i" insn language supported an option to trigger --reset-author (or even better, --author=...) action for a single commit, but I presume that it is rather a rare event, and as long as people understand that they can stop the sequencing (e.g., an "edit" of the commit would do) and run "commit --amend", it should be OK, so it probably is OK to leave it as-is.

Thanks.

#5 lore raw
In reply to Oswald Buddenhagen
Quoted 3 lines · Oswald Buddenhagen
---
 Documentation/git-rebase.txt | 29 +++++++++++++++--------------
 1 file changed, 15 insertions(+), 14 deletions(-)

The new documentation below looks fine, and I don't have strong feelings beyond the proposed modifications.

The line wrapping is a little odd: it looks like each sentence begins on a its own line. Did you mean for there to be a visual separation between those sentences in the rendered doc? If so, replace the single line feed with a pair of them.

If not, this looks good to me as-is.

Thanks,
Taylor

#6 lore raw
Quoted 2 lines · Taylor Blau

The line wrapping is a little odd: it looks like each sentence begins on a its own line.

this is indeed the case.

Quoted 2 lines

Did you mean for there to be a visual separation between those sentences in the rendered doc?

no.

the idea is to keep the churn down in later edits, by making reflowing the entire paragraph visibly unnecesary. i can change it if it's deemed too weird.

regards

#7 lore raw
In reply to Oswald Buddenhagen
Quoted 9 lines · Oswald Buddenhagen

Create a clear top-down structure which makes it hopefully unambiguous what happens when.

Also mention the timestamp along with the author - this is primarily meant to include the keywords somebody might be searching for, like I did a year ago.

Quoted 8 lines

---
v2:
- slight adjustments inspired by marc. however, i left most things unchanged or even went in the opposite direction, because i assume the readers to be sufficiently context-sensitive, and the objective is merely to be not actively confusing. adding redundancy in the name of clarity would just make the text stylistically inferior and arguably harder to read.

I disagree with this on many levels, but your tone seems to brook no discussion and I do not want to get into a protracted debate here.

I will only say that, I personally don't read man pages from start-to-end like a novel. I jump to the part that explains the thing I need to learn about. So I think your assumptions about what context a reader might have in mind when they see this text are invalid.

Since we have very different notions about who is reading this, I think we'll never agree on the final wording. I'll continue to make my suggestions, but I won't stand in the way of these changes if I'm the only one who thinks they could be better.

Quoted 24 lines
Cc Junio C Hamano <[email protected]>
Cc Phillip Wood <[email protected]>
Cc Christian Couder <[email protected]>
Cc Charvi Mendiratta <[email protected]>
Cc Marc Branchaud <[email protected]>
---
  Documentation/git-rebase.txt | 29 +++++++++++++++--------------
  1 file changed, 15 insertions(+), 14 deletions(-)
Documentation/git-rebase.txt +0 -7
index e7b39ad244..337df9ef2f 100644
@@ -890,20 +890,21 @@ command "pick" with the command "reword".
  To drop a commit, replace the command "pick" with "drop", or just
  delete the matching line.
 
-If you want to fold two or more commits into one, replace the command
-"pick" for the second and subsequent commits with "squash" or "fixup".
-If the commits had different authors, the folded commit will be
-attributed to the author of the first commit.  The suggested commit
-message for the folded commit is the concatenation of the first
-commit's message with those identified by "squash" commands, omitting the
-messages of commits identified by "fixup" commands, unless "fixup -c"

Documentation/git-rebase.txt command "pick" with the command "reword". · line 895

Quoted 10 lines
Documentation/git-rebase.txt +3 -7
-is used.  In that case the suggested commit message is only the message
-of the "fixup -c" commit, and an editor is opened allowing you to edit
-the message.  The contents (patch) of the "fixup -c" commit are still
-incorporated into the folded commit. If there is more than one "fixup -c"
-commit, the message from the final one is used.  You can also use
-"fixup -C" to get the same behavior as "fixup -c" except without opening
-an editor.
+If you want to fold two or more commits into one (that is, to combine
+their contents/patches), replace the command "pick" for the second and
+subsequent commits with "squash" or "fixup".

s/the command "pick"/the "pick" command/

Documentation/git-rebase.txt command "pick" with the command "reword". · line 897

Quoted 2 lines
Documentation/git-rebase.txt +2 -0
+The commit message for the folded commit is the concatenation of the
+message of the first commit with those of commits identified by "squash"

s/message of the first commit/picked commit's message/

Documentation/git-rebase.txt command "pick" with the command "reword". · line 901

Quoted 4 lines
Documentation/git-rebase.txt +4 -0
+commands, omitting those of commits identified by "fixup" commands,
+unless "fixup -c" is used. In the latter case, the message is obtained
+only from the "fixup -c" commit (having more than one of these is
+incorrect).

As Phillip said, this is wrong. I agree with Phillip that the documentation should reflect the actual implementation, not what we hope the implementation might be some day.

Documentation/git-rebase.txt command "pick" with the command "reword". · line 906

Quoted 5 lines
Documentation/git-rebase.txt +5 -0
+If the resulting commit message is a concatenation of multiple messages,
+an editor is opened allowing you to edit it. This is also the case for a
+message obtained via "fixup -c", while using "fixup -C" instead skips
+the editor; this is analogous to the behavior of `git commit`.
+The first commit which contributes to the suggested commit message also

s/suggested/folded/ -- with "fixup -C" there is no "suggested" message.

Thanks,

		M.
#8 lore raw
Quoted 2 lines · Marc Branchaud

I will only say that, I personally don't read man pages from start-to-end like a novel. I jump to the part that explains the thing I need to learn about. So I think your assumptions about what context a reader might have in mind when they see this text are invalid.

we are speaking about the context of a single paragraph, so that doesn't seem like a relevant objection.

Quoted 5 lines

Documentation/git-rebase.txt command "pick" with the command "reword". · line 897

Quoted 2 lines
Documentation/git-rebase.txt +2 -0
+The commit message for the folded commit is the concatenation of the
+message of the first commit with those of commits identified by "squash"

s/message of the first commit/picked commit's message/

that does indeed sound better, but i think it's more confusing (and potentially even more so when translated directly). i guess one could use "pick'd commit's", but that's kind of ugly again.

Quoted 7 lines

Documentation/git-rebase.txt command "pick" with the command "reword". · line 901

Quoted 4 lines
Documentation/git-rebase.txt +4 -0
+commands, omitting those of commits identified by "fixup" commands,
+unless "fixup -c" is used. In the latter case, the message is obtained
+only from the "fixup -c" commit (having more than one of these is
+incorrect).

As Phillip said, this is wrong. I agree with Phillip that the documentation should reflect the actual implementation, not what we hope the implementation might be some day.

there is also the middle ground of making it intentionally vague in anticipation of a possible change. my current draft says "if multiple are present, the last one takes precedence, but this should not be relied upon".

Quoted 5 lines
Quoted 2 lines

+The first commit which contributes to the suggested commit message also

s/suggested/folded/ -- with "fixup -C" there is no "suggested" message.

that's a good point, but i want to emphasize the fact that it's the pre-edit message, i.e., that trimming down the squashed message doesn't change anything. anyway, this part will be postponed to another contribution anyway (see parallel thread).

thanks

#9 lore raw
Quoted 8 lines · Oswald Buddenhagen
Quoted 7 lines
Quoted 4 lines
(quoted diff) +2 -0
+The commit message for the folded commit is the concatenation of the
+message of the first commit with those of commits identified by 

"squash"

s/message of the first commit/picked commit's message/

that does indeed sound better, but i think it's more confusing (and potentially even more so when translated directly). i guess one could use "pick'd commit's", but that's kind of ugly again.

Let the translators worry about how to phrase it in other languages. In English "picked" is the right choice. You should not presume that other languages will want to use the word "pick" verbatim.

		M.
#10 lore raw
Quoted 8 lines · Marc Branchaud
Quoted 7 lines · Oswald Buddenhagen
Quoted 7 lines
Quoted 4 lines

+The commit message for the folded commit is the concatenation of the
+message of the first commit with those of commits identified by "squash"

s/message of the first commit/picked commit's message/

Quoted 4 lines
Quoted 1 line

that does indeed sound better, but i think it's more confusing (and potentially even more so when translated directly). i guess one could use "pick'd commit's", but that's kind of ugly again.

Let the translators worry about how to phrase it in other languages.

my experience tells me that this isn't a good idea. translations are often done by people who have little domain knowledge of what they translate. it's a good idea to guide them. also, the english text is often read by people who barely understand english, and will attempt literal translations in their head.

Quoted 2 lines

In English "picked" is the right choice.

the squashed commits also fit the natural use of "picked", because "picking" means "selecting". it's not advisable to use this potentially ambiguous term when there is an unambiguous alternative way to identify the commit available.

Quoted 2 lines

You should not presume that other languages will want to use the word "pick" verbatim.

well, i actually should, because it's the command's own name, which definitely shouldn't be translated.

regards

#11 lore raw

PATCH v3 1/1 git-rebase.txt: rewrite docu for fixup/squash (again)

In reply to Oswald Buddenhagen

Create a clear top-down structure which makes it hopefully unambiguous what happens when.

The behavior in the presence of multiple "fixup -c" is somewhat questionable, as arguably it would be better to complain about it rather than letting the last instance win. But for the time being we document the status quo, with a note that it is not guaranteed. Note that actually changing it would require --autosquash eliding the superseded uses.

Also emphasize that the author info of the first commit is preserved even in the presence of "fixup -c", as this diverges from "git commit -c"'s behavior. New options matching the latter should be introduced for completeness.

---
v3:
- adjust to reality, and elaborate in the commit message why it's arguably somewhat suboptimal

i deliberated the 'command "pick"' word order swap suggested by marc, but while it improves things locally, it somehow doesn't flow with the "redundancy-reduced" last part of the sentence.

v2:
- slight adjustments inspired by marc. however, i left most things unchanged or even went in the opposite direction, because i assume the readers to be sufficiently context-sensitive, and the objective is merely to be not actively confusing. adding redundancy in the name of clarity would just make the text stylistically inferior and arguably harder to read.

Cc Junio C Hamano <[email protected]>
Cc Phillip Wood <[email protected]>
Cc Taylor Blau <[email protected]>
Cc Christian Couder <[email protected]>
Cc Charvi Mendiratta <[email protected]>
Cc Marc Branchaud <[email protected]>
---
 Documentation/git-rebase.txt | 30 ++++++++++++++++--------------
 1 file changed, 16 insertions(+), 14 deletions(-)
Documentation/git-rebase.txt +16 -14
index e7b39ad244..578d1d34a6 100644
@@ -890,20 +890,22 @@ command "pick" with the command "reword".
 To drop a commit, replace the command "pick" with "drop", or just
 delete the matching line.
 
-If you want to fold two or more commits into one, replace the command
-"pick" for the second and subsequent commits with "squash" or "fixup".
-If the commits had different authors, the folded commit will be
-attributed to the author of the first commit.  The suggested commit
-message for the folded commit is the concatenation of the first
-commit's message with those identified by "squash" commands, omitting the
-messages of commits identified by "fixup" commands, unless "fixup -c"
-is used.  In that case the suggested commit message is only the message
-of the "fixup -c" commit, and an editor is opened allowing you to edit
-the message.  The contents (patch) of the "fixup -c" commit are still
-incorporated into the folded commit. If there is more than one "fixup -c"
-commit, the message from the final one is used.  You can also use
-"fixup -C" to get the same behavior as "fixup -c" except without opening
-an editor.
+If you want to fold two or more commits into one (that is, to combine
+their contents/patches), replace the command "pick" for the second and
+subsequent commits with "squash" or "fixup".
+The commit message for the folded commit is the concatenation of the
+message of the first commit with those of commits identified by "squash"
+commands, omitting those of commits identified by "fixup" commands,
+unless "fixup -c" is used. In the latter case, the message is obtained
+only from the "fixup -c" commit (if multiple are present, the last one
+takes precedence, but this should not be relied upon).
+If the resulting commit message is a concatenation of multiple messages,
+an editor is opened allowing you to edit it. This is also the case for a
+message obtained via "fixup -c", while using "fixup -C" instead skips
+the editor; this is analogous to the behavior of `git commit`.
+The author information (including date/timestamp) always comes from
+the first commit; this is the case even if "fixup -c/-C" is used,
+contrary to what `git commit` does.
 
 `git rebase` will stop when "pick" has been replaced with "edit" or
 when a command fails due to merge errors. When you are done editing
Signature · 1 line
2.42.0.419.g70bf8a5751
#12 lore raw
Quoted 9 lines · Oswald Buddenhagen

Create a clear top-down structure which makes it hopefully unambiguous what happens when.

The behavior in the presence of multiple "fixup -c" is somewhat questionable, as arguably it would be better to complain about it rather than letting the last instance win. But for the time being we document the status quo, with a note that it is not guaranteed. Note that actually changing it would require --autosquash eliding the superseded uses.

I do not think this kind of editorializing belongs in the commit's message, but this likely isn't the first commit message that expresses an opinion.

Quoted 55 lines

Also emphasize that the author info of the first commit is preserved even in the presence of "fixup -c", as this diverges from "git commit -c"'s behavior. New options matching the latter should be introduced for completeness.

---
v3:
- adjust to reality, and elaborate in the commit message why it's arguably somewhat suboptimal

i deliberated the 'command "pick"' word order swap suggested by marc, but while it improves things locally, it somehow doesn't flow with the "redundancy-reduced" last part of the sentence.

v2:
- slight adjustments inspired by marc. however, i left most things unchanged or even went in the opposite direction, because i assume the readers to be sufficiently context-sensitive, and the objective is merely to be not actively confusing. adding redundancy in the name of clarity would just make the text stylistically inferior and arguably harder to read.

Cc Junio C Hamano <[email protected]>
Cc Phillip Wood <[email protected]>
Cc Taylor Blau <[email protected]>
Cc Christian Couder <[email protected]>
Cc Charvi Mendiratta <[email protected]>
Cc Marc Branchaud <[email protected]>
---
  Documentation/git-rebase.txt | 30 ++++++++++++++++--------------
  1 file changed, 16 insertions(+), 14 deletions(-)
Documentation/git-rebase.txt +0 -13
index e7b39ad244..578d1d34a6 100644
@@ -890,20 +890,22 @@ command "pick" with the command "reword".
  To drop a commit, replace the command "pick" with "drop", or just
  delete the matching line.
 
-If you want to fold two or more commits into one, replace the command
-"pick" for the second and subsequent commits with "squash" or "fixup".
-If the commits had different authors, the folded commit will be
-attributed to the author of the first commit.  The suggested commit
-message for the folded commit is the concatenation of the first
-commit's message with those identified by "squash" commands, omitting the
-messages of commits identified by "fixup" commands, unless "fixup -c"
-is used.  In that case the suggested commit message is only the message
-of the "fixup -c" commit, and an editor is opened allowing you to edit
-the message.  The contents (patch) of the "fixup -c" commit are still
-incorporated into the folded commit. If there is more than one "fixup -c"
-commit, the message from the final one is used.  You can also use
-"fixup -C" to get the same behavior as "fixup -c" except without opening

Documentation/git-rebase.txt command "pick" with the command "reword". · line 901

Quoted 10 lines
Documentation/git-rebase.txt +9 -1
-an editor.
+If you want to fold two or more commits into one (that is, to combine
+their contents/patches), replace the command "pick" for the second and
+subsequent commits with "squash" or "fixup".
+The commit message for the folded commit is the concatenation of the
+message of the first commit with those of commits identified by "squash"
+commands, omitting those of commits identified by "fixup" commands,
+unless "fixup -c" is used. In the latter case, the message is obtained
+only from the "fixup -c" commit (if multiple are present, the last one
+takes precedence, but this should not be relied upon).

I like the overall phrasing here.

But I think you should remove the "but this should not be relied upon" phrase. This reads as if Git's current behaviour is undefined, which most definitely is not true.

Even changing this to something like "but this might change in the future" is unhelpful. Everything in Git is subject to change over a long-enough time span, so the same could be said about every aspect of Git.

Until the behaviour actually changes, it's perfectly fine for people to use multiple "fixup -c" commands. There's no reason to scare them off of it.

Documentation/git-rebase.txt command "pick" with the command "reword". · line 908

Quoted 7 lines
Documentation/git-rebase.txt +7 -0
+If the resulting commit message is a concatenation of multiple messages,
+an editor is opened allowing you to edit it. This is also the case for a
+message obtained via "fixup -c", while using "fixup -C" instead skips
+the editor; this is analogous to the behavior of `git commit`.
+The author information (including date/timestamp) always comes from
+the first commit; this is the case even if "fixup -c/-C" is used,
+contrary to what `git commit` does.

This phrasing is much better.

Thanks for putting up with my pedantry!

		M.
#13 lore raw
Quoted 10 lines · Marc Branchaud
Quoted 6 lines · Oswald Buddenhagen

The behavior in the presence of multiple "fixup -c" is somewhat questionable, as arguably it would be better to complain about it rather than letting the last instance win. But for the time being we document the status quo, with a note that it is not guaranteed. Note that actually changing it would require --autosquash eliding the superseded uses.

I do not think this kind of editorializing belongs in the commit's message, but this likely isn't the first commit message that expresses an opinion.

commmit messages should elaborate alternatives considered, which includes ones which depend on changes that can be reasonably expected to possibly happen at some point.

Quoted 6 lines

But I think you should remove the "but this should not be relied upon" phrase. This reads as if Git's current behaviour is undefined, which most definitely is not true.

Even changing this to something like "but this might change in the future" is unhelpful. Everything in Git is subject to change over a long-enough time span, so the same could be said about every aspect of Git.

Until the behaviour actually changes, it's perfectly fine for people to use multiple "fixup -c" commands. There's no reason to scare them off of it.

things can't change overnight; the resistance even the most trivial behavior changes meet is enormous. so explicitly documenting long in advance that something is subject to change is basically the only way to get it changed at all.

specifically for this feature, there is no reason at all to rely on this behavior when hand-editing the todo list, and occurrences most likely indicate a mistake, which is why i would prefer it to be rejected.

regards

#14 lore raw
In reply to Marc Branchaud
Quoted 3 lines · Marc Branchaud

I do not think this kind of editorializing belongs in the commit's message, but this likely isn't the first commit message that expresses an opinion.

Thanks for saying this.

Quoted 6 lines

I like the overall phrasing here.

But I think you should remove the "but this should not be relied upon" phrase. This reads as if Git's current behaviour is undefined, which most definitely is not true.

Quoted 8 lines

Even changing this to something like "but this might change in the future" is unhelpful. Everything in Git is subject to change over a long-enough time span, so the same could be said about every aspect of Git.

Until the behaviour actually changes, it's perfectly fine for people to use multiple "fixup -c" commands. There's no reason to scare them off of it.

And that would simplify the description to make it easier to follow by readers who are *not* involved in the development process.

Quoted 11 lines

Documentation/git-rebase.txt command "pick" with the command "reword". · line 908

Quoted 8 lines
Documentation/git-rebase.txt +7 -0
+If the resulting commit message is a concatenation of multiple messages,
+an editor is opened allowing you to edit it. This is also the case for a
+message obtained via "fixup -c", while using "fixup -C" instead skips
+the editor; this is analogous to the behavior of `git commit`.
+The author information (including date/timestamp) always comes from
+the first commit; this is the case even if "fixup -c/-C" is used,
+contrary to what `git commit` does.

This phrasing is much better.

Quoted 1 line

Thanks for putting up with my pedantry!

Thanks for a good review. I guess the patch is very near the finish line?

#15 lore raw
Quoted 3 lines · Junio C Hamano

Thanks for a good review. I guess the patch is very near the finish line?

Yes. In my mind, all that's needed is to remove the part about "should not be relied upon".

		M.
#16 lore raw
In reply to Marc Branchaud
Quoted 35 lines · Marc Branchaud
Quoted 22 lines
Documentation/git-rebase.txt +0 -0
index e7b39ad244..578d1d34a6 100644
@@ -890,20 +890,22 @@ command "pick" with the command "reword".

  To drop a commit, replace the command "pick" with "drop", or just delete the matching line.

Documentation/git-rebase.txt +0 -6
-If you want to fold two or more commits into one, replace the command
-"pick" for the second and subsequent commits with "squash" or "fixup".
-If the commits had different authors, the folded commit will be
-attributed to the author of the first commit.  The suggested commit
-message for the folded commit is the concatenation of the first
-commit's message with those identified by "squash" commands, omitting 

the

Documentation/git-rebase.txt +0 -8
-messages of commits identified by "fixup" commands, unless "fixup -c"
-is used.  In that case the suggested commit message is only the message
-of the "fixup -c" commit, and an editor is opened allowing you to edit
-the message.  The contents (patch) of the "fixup -c" commit are still
-incorporated into the folded commit. If there is more than one "fixup 
-c"
-commit, the message from the final one is used.  You can also use
-"fixup -C" to get the same behavior as "fixup -c" except without opening

Documentation/git-rebase.txt command "pick" with the command "reword". · line 901

Quoted 10 lines
Documentation/git-rebase.txt +9 -1
-an editor.
+If you want to fold two or more commits into one (that is, to combine
+their contents/patches), replace the command "pick" for the second and
+subsequent commits with "squash" or "fixup".
+The commit message for the folded commit is the concatenation of the
+message of the first commit with those of commits identified by "squash"
+commands, omitting those of commits identified by "fixup" commands,
+unless "fixup -c" is used. In the latter case, the message is obtained
+only from the "fixup -c" commit (if multiple are present, the last one
+takes precedence, but this should not be relied upon).

I like the overall phrasing here.

Quoted 1 line

But I think you should remove the "but this should not be relied upon" phrase.  This reads as if Git's current behaviour is undefined, which most definitely is not true.

I agree it would be better to remove that phrase, as you say it makes it sounds like the behaviour cannot be relied on.

Quoted 3 lines

Even changing this to something like "but this might change in the future" is unhelpful.  Everything in Git is subject to change over a long-enough time span, so the same could be said about every aspect of Git.

Until the behaviour actually changes, it's perfectly fine for people to use multiple "fixup -c" commands.  There's no reason to scare them off of it.

Indeed

Best Wishes

Phillip