git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
PWPhillip Wood <phillip.wood123@gmail.com>
Date
Oct 30, 2023, 09:55 UTC
Message-ID
<2daced1b-574e-442c-9cca-fa5050946f2f@gmail.com>
In-Reply-To
<56e3e974-a027-439f-871d-c7fbae65a04e@xiplink.com>
On 27/10/2023 14:14, Marc Branchaud wrote:
Show 38 quoted lines
>> diff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt
>> index e7b39ad244..578d1d34a6 100644
>> --- a/Documentation/git-rebase.txt
>> +++ b/Documentation/git-rebase.txt
>> @@ -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).
> 
> 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.

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

Show 7 quoted 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
Previous: Marc Branchaud
Message 17 of 17 in “[RESEND v2] git-rebase.txt: rewrite docu for fixup/squash (again)”
  1. Oswald BuddenhagenOct 23, 2023
  2. Phillip WoodOct 23, 2023
  3. Oswald BuddenhagenOct 23, 2023
  4. Phillip WoodOct 24, 2023
  5. Junio C HamanoOct 24, 2023
  6. Taylor BlauOct 23, 2023
  7. Oswald BuddenhagenOct 24, 2023
  8. Marc BranchaudOct 24, 2023
  9. Oswald BuddenhagenOct 24, 2023
  10. Marc BranchaudOct 27, 2023
  11. Oswald BuddenhagenOct 27, 2023
  12. git-rebase.txt: rewrite docu for fixup/squash (again)Oswald Buddenhagen, Oct 25, 2023
  13. Marc BranchaudOct 27, 2023
  14. Oswald BuddenhagenOct 27, 2023
  15. Junio C HamanoOct 27, 2023
  16. Marc BranchaudOct 31, 2023
  17. Phillip WoodOct 30, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.