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

Re: [PATCH v2 3/3] rebase --continue: remove .git/MERGE_MSG

From
PWPhillip Wood <phillip.wood123@gmail.com>
Date
Aug 14, 2021, 20:01 UTC
Message-ID
<549ebc1e-2b3d-786b-6467-40fb521ea0cc@gmail.com>
In-Reply-To
<xmqqa6lluexv.fsf@gitster.g>
On 14/08/2021 00:01, Junio C Hamano wrote:
Show 12 quoted lines
> "Phillip Wood via GitGitGadget" <gitgitgadget@gmail.com> writes:
> 
>> From: Phillip Wood <phillip.wood@dunelm.org.uk>
>>
>> If the user skips the final commit by removing all the changes from
>> the index and worktree with 'git restore' (or read-tree) and then runs
>> 'git rebase --continue' .git/MERGE_MSG is left behind. This will seed
>> the commit message the next time the user commits which is not what we
>> want to happen.
> 
> I just remembered that "git rebase --skip" option exists.  Would it
> have the same issue if used at the last step?

--skip calls rerere_clear() which unlinks .git/MERGE_MSG. This patch adds a test for --skip as well as --continue.

Best Wishes
Phillip
Show 13 quoted lines
> 
> [Footnote]
> 
> I am not saying that it is an error to use "git restore HEAD . &&
> git rebase --continue" when you'd usually use "git rebase --skip".
> 
> Nuking the difference the working tree files and the index has
> relative to HEAD and telling the machinery to continue gives the
> signal that the "conflict resolution" happened to have resulted in
> an empty change, which should yield the same resulting history as
> "git rebase --skip" would, because the resulting empty change should
> be dropped (unless --empty=keep is in effect, that is).
> 
Previous: Junio C HamanoNext: Elijah Newren
Message 21 of 25 in “rebase --continue: remove .git/MERGE_MSG”
  1. 0/3 rebase --continue: remove .git/MERGE_MSGPhillip Wood via GitGitGadget, Aug 10, 2021
  2. 1/3 t3403: fix commit authorshipPhillip Wood via GitGitGadget, Aug 10, 2021
  3. Elijah NewrenAug 10, 2021
  4. Junio C HamanoAug 10, 2021
  5. Phillip WoodAug 12, 2021
  6. Johannes SchindelinAug 14, 2021
  7. Junio C HamanoAug 15, 2021
  8. Phillip WoodAug 15, 2021
  9. Junio C HamanoAug 16, 2021
  10. Phillip WoodAug 17, 2021
  11. 2/3 rebase --apply: restore some testsPhillip Wood via GitGitGadget, Aug 10, 2021
  12. Elijah NewrenAug 10, 2021
  13. Phillip WoodAug 12, 2021
  14. 3/3 rebase --continue: remove .git/MERGE_MSGPhillip Wood via GitGitGadget, Aug 10, 2021
  15. Elijah NewrenAug 10, 2021
  16. 0/3 rebase --continue: remove .git/MERGE_MSGPhillip Wood via GitGitGadget, Aug 12, 2021
  17. 1/3 t3403: fix commit authorshipPhillip Wood via GitGitGadget, Aug 12, 2021
  18. 2/3 rebase --apply: restore some testsPhillip Wood via GitGitGadget, Aug 12, 2021
  19. 3/3 rebase --continue: remove .git/MERGE_MSGPhillip Wood via GitGitGadget, Aug 12, 2021
  20. Junio C HamanoAug 13, 2021
  21. Phillip WoodAug 14, 2021
  22. Elijah NewrenAug 13, 2021
  23. Junio C HamanoAug 13, 2021
  24. Elijah NewrenAug 13, 2021
  25. Phillip WoodAug 14, 2021

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.