{"thread":{"id":"56215","subject":"commit following rebase has unexpected commit message","startedAt":"2021-08-04T14:20:14Z","lastAt":"2021-08-05T10:02:14Z","messageCount":2,"participants":["Victor Gambier","Phillip Wood"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"431955","messageId":"CAMsiUYDD3jTyP-pK7PiydECkUAJspzosc8mWNSFpcLru70zXbQ@mail.gmail.com","threadId":"56215","inReplyTo":null,"subject":"commit following rebase has unexpected commit message","fromName":"Victor Gambier","fromEmail":"vgambier@excilys.com","sentAt":"2021-08-04T14:19:12Z","receivedAt":"2021-08-04T14:20:14Z","isPatch":false,"sender":{"key":"vgambier@excilys.com","avatar":null},"body":"\n\n\nThank you for filling out a Git bug report!\nPlease answer the following questions to help us understand your issue.\n\nWhat did you do before the bug happened? (Steps to reproduce your issue)\n\ngit switch -c first\ngit switch -c second\n[modify a file]\ngit commit -am \"foo\"\ngit switch first\n[modify the same file in a conflicting way]\ngit commit -am \"bar\"\ngit rebase second\ngit restore --staged .\ngit restore .\ngit rebase --continue\n[modify any file - can be the same file again]\ngit commit -a\n\nWhat did you expect to happen? (Expected behavior)\n\nThe text editor should pop up and the first line should be blank (no default commit message).\n\nWhat happened instead? (Actual behavior)\n\nThe text editor pops up, and the first four lines of the default commit message seem to pertain to the rebase:\n\n\tbar\n\t\n\t# Conflicts:\n\t#\tfrontend/src/styling/rounds.ts\n\t\nEven though the contents of the commit correctly pertain to the very last changes and are unrelated to the rebase.\n\nWhat's different between what you expected and what actually happened?\n\nThe default commit message.\n\nAnything else you want to add:\n\nA second anomaly is that if you replace the last command with git commit -a --no-edit, the two lines starting with '#' are NOT ignored and will be present in the final commit message.\n\nPlease review the rest of the bug report below.\nYou can delete any lines you don't wish to share.\n\n\n[System Info]\ngit version:\ngit version 2.30.0.windows.2\ncpu: x86_64\nbuilt from commit: f8cbc844b81bf6b9e72178bbe891a86c8bf5e9e7\nsizeof-long: 4\nsizeof-size_t: 8\nshell-path: /bin/sh\nuname: Windows 10.0 18363 \ncompiler info: gnuc: 10.2\nlibc info: no libc information available\n$SHELL (typically, interactive shell): C:\\Program Files\\Git\\usr\\bin\\bash.exe\n\n\n[Enabled Hooks]\n"},{"id":"432075","messageId":"d47652d2-7353-f4ff-5549-ef1c2bc6a381@gmail.com","threadId":"56215","inReplyTo":"CAMsiUYDD3jTyP-pK7PiydECkUAJspzosc8mWNSFpcLru70zXbQ@mail.gmail.com","subject":"Re: commit following rebase has unexpected commit message","fromName":"Phillip Wood","fromEmail":"phillip.wood123@gmail.com","sentAt":"2021-08-05T10:02:07Z","receivedAt":"2021-08-05T10:02:14Z","isPatch":false,"sender":{"key":"phillip.wood@dunelm.org.uk","avatar":null},"body":"Hi Victor\n\nOn 04/08/2021 15:19, Victor Gambier wrote:\n > Thank you for filling out a Git bug report!\n > Please answer the following questions to help us understand your issue.\n >\n > What did you do before the bug happened? (Steps to reproduce your issue)\n >\n > git switch -c first\n > git switch -c second\n > [modify a file]\n > git commit -am \"foo\"\n > git switch first\n > [modify the same file in a conflicting way]\n > git commit -am \"bar\"\n > git rebase second\n > git restore --staged .\n > git restore .\n > git rebase --continue\n > [modify any file - can be the same file again]\n > git commit -a\n >\n > What did you expect to happen? (Expected behavior)\n >\n > The text editor should pop up and the first line should be blank (no \ndefault commit message).\n >\n > What happened instead? (Actual behavior)\n >\n > The text editor pops up, and the first four lines of the default \ncommit message seem to pertain to the rebase:\n >\n > \tbar\n >\n > \t# Conflicts:\n > \t#\tfrontend/src/styling/rounds.ts\n >\n > Even though the contents of the commit correctly pertain to the very \nlast changes and are unrelated to the rebase.\n\n\nThanks for the detailed report, I think the problem is that when rebase \nstops for the user to resolve conflicts it writes .git/MERGE_MSG which \nis removed when the conflict resolution is committed or by 'git reset' \nif the user skips the commit. In this case the commit is effectively \nskipped but the file is not removed and so seeds the editor when you \nnext make a commit. I'll try and put a patch together next week.\n\nBest Wishes\n\nPhillip\n\n > What's different between what you expected and what actually happened?\n >\n > The default commit message.\n >\n > Anything else you want to add:\n >\n > A second anomaly is that if you replace the last command with git \ncommit -a --no-edit, the two lines starting with '#' are NOT ignored and \nwill be present in the final commit message.\n >\n > Please review the rest of the bug report below.\n > You can delete any lines you don't wish to share.\n >\n >\n > [System Info]\n > git version:\n > git version 2.30.0.windows.2\n > cpu: x86_64\n > built from commit: f8cbc844b81bf6b9e72178bbe891a86c8bf5e9e7\n > sizeof-long: 4\n > sizeof-size_t: 8\n > shell-path: /bin/sh\n > uname: Windows 10.0 18363\n > compiler info: gnuc: 10.2\n > libc info: no libc information available\n > $SHELL (typically, interactive shell): C:\\Program \nFiles\\Git\\usr\\bin\\bash.exe\n >\n >\n > [Enabled Hooks]\n"}]}