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

Re: [PATCH] rebase --skip: fix commit message clean up when skipping squash

From
Marc Branchaud <marcnarc@xiplink.com>
Date
Aug 3, 2023, 20:38 UTC
Message-ID
<32c8a181-76aa-5c90-427a-53b1ccdec8a3@xiplink.com>
In-Reply-To
<pull.1558.git.git.1691068176051.gitgitgadget@gmail.com>
On 2023-08-03 09:09, Phillip Wood via GitGitGadget wrote:
Show 21 quoted lines
> From: Phillip Wood <phillip.wood@dunelm.org.uk>
> 
> During a series of "fixup" and/or "squash" commands, the interactive
> rebase accumulates a commit message from all the commits that are being
> squashed together. If one of the commits has conflicts when it is picked
> and the user chooses to skip that commit then we need to remove that
> commit's message from accumulated messages.  To do this 15ef69314d5
> (rebase --skip: clean up commit message after a failed fixup/squash,
> 2018-04-27) updated commit_staged_changes() to reset the accumulated
> message to the commit message of HEAD (which does not contain the
> message from the skipped commit) when the last command was "fixup" or
> "squash" and there are no staged changes. Unfortunately the code to do
> this contains two bugs.
> 
> (1) If parse_head() fails we pass an invalid pointer to
>      unuse_commit_buffer().
> 
> (2) The reconstructed message uses the entire commit buffer from HEAD
>      including the headers, rather than just the commit message.
> 
> The fist issue is fixed by splitting up the "if" condition into several
s/fist/first/

(I'm not qualified to review anything else about this patch, but I like its intention... :D )

		M.
Previous: Junio C HamanoNext: Phillip Wood
Message 5 of 6 in “rebase --skip: fix commit message clean up when skipping squash”
  1. rebase --skip: fix commit message clean up when skipping squashPhillip Wood via GitGitGadget, Aug 3, 2023
  2. Junio C HamanoAug 3, 2023
  3. Phillip WoodAug 7, 2023
  4. Junio C HamanoAug 7, 2023
  5. Marc BranchaudAug 3, 2023
  6. Phillip WoodAug 7, 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.