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

Commit amend during a merge conflict

From
MWMatan Wiesner <matanwis@gmail.com>
Date
Oct 20, 2022, 08:24 UTC
Message-ID
<CA+vqH8+zCbyF39ycKv-4=t+U2hOx7t3w5EB-+bSeyH9HdfsjMQ@mail.gmail.com>
Hi
When I use git to edit a long change of commit there are two scenarios I meet:
1. edit existing commit - in this case I do "git rebase -i", stop in
my commit, them run "git commit --amend" and them run "git rebase
--continue"
2. rebase and solve conflicts - when I rebase (for example on top of
main branch) and meet a conflict : "cannot apply commit A" I need to
solve these conflict, then run "git rebase --continue", it easy to
confuse and run "git commit --amend" and in this scenario, that leads
to commit A and the commit before A to be squashed.
My claim is, that there is no scenario that the user actually wants to
commit (and not run "rebase --continue") when there are merge
conflicts, therefore git should block this option.

As a reference to support my claim, I link 2 stack overflow threads of users that did this mistake https://stackoverflow.com/questions/41439424/i-amended-instead-of-resolving-conflict-in-interactive-rebase-can-i-undo https://stackoverflow.com/questions/11116572/git-commit-during-git-rebase-what-really-happens

WDYT?
Message 1 of 1 in “Commit amend during a merge conflict”
  1. Matan WiesnerOct 20, 2022

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.