From: Marc Branchaud Date: Thu, 03 Aug 2023 20:38:57 GMT Subject: Re: [PATCH] rebase --skip: fix commit message clean up when skipping squash Message-ID: <32c8a181-76aa-5c90-427a-53b1ccdec8a3@xiplink.com> In-Reply-To: On 2023-08-03 09:09, Phillip Wood via GitGitGadget wrote: > From: Phillip Wood > > 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.