{"thread":{"id":"48695","subject":"`git merge --abort` does not run `git rerere clear`","startedAt":"2018-06-12T19:32:32Z","lastAt":"2018-06-12T22:35:35Z","messageCount":3,"participants":["Sam Kuper","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"350010","messageId":"CAD-JurLXh=rOC=bhjTa8jCpeDWkbDhCztSpjLuMEUGm1-QnAiw@mail.gmail.com","threadId":"48695","inReplyTo":null,"subject":"`git merge --abort` does not run `git rerere clear`","fromName":"Sam Kuper","fromEmail":"sam.kuper@uclmail.net","sentAt":"2018-06-12T19:32:28Z","receivedAt":"2018-06-12T19:32:32Z","isPatch":false,"sender":{"key":"sam.kuper@uclmail.net","avatar":"https://gravatar.com/avatar/ae189c4c56e5cd31dc7371016f169e68aef81a3ea3318041a1ca4be46f10435b?d=mp&s=160"},"body":"`man git-rerere` says:\n\n> clear\n>\n> Reset the metadata used by rerere if a merge resolution is to be\n> aborted. Calling git am [--skip|--abort] or git rebase\n> [--skip|--abort] will automatically invoke this command.\n\nIt makes sense that `git am [--skip|--abort]` and `git rebase\n[--skip|--abort]` would run `git rerere clear`.\n\nHowever, if they run it, then shouldn't `git merge --abort` run it, too?\n\nIf not, then what is the reason why not, and might it be helpful for\nthis reason to be mentioned at some appropriate place in the\ndocumentation?\n\nThanks :)\n"},{"id":"350012","messageId":"xmqqr2lb9406.fsf@gitster-ct.c.googlers.com","threadId":"48695","inReplyTo":"CAD-JurLXh=rOC=bhjTa8jCpeDWkbDhCztSpjLuMEUGm1-QnAiw@mail.gmail.com","subject":"Re: `git merge --abort` does not run `git rerere clear`","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-06-12T19:52:25Z","receivedAt":"2018-06-12T19:52:30Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Sam Kuper <sam.kuper@uclmail.net> writes:\n\n> `man git-rerere` says:\n>\n>> clear\n>>\n>> Reset the metadata used by rerere if a merge resolution is to be\n>> aborted. Calling git am [--skip|--abort] or git rebase\n>> [--skip|--abort] will automatically invoke this command.\n>\n> It makes sense that `git am [--skip|--abort]` and `git rebase\n> [--skip|--abort]` would run `git rerere clear`.\n>\n> However, if they run it, then shouldn't `git merge --abort` run it, too?\n>\n> If not, then what is the reason why not, and might it be helpful for\n> this reason to be mentioned at some appropriate place in the\n> documentation?\n\nI do not think there was any reason, other than that those who added\n\"git merge --abort\" weren't as careful as they should have been ;-)\n\nThe command is a mere synonym to \"git reset --merge\"; I am not so\nconfident that \"git reset --merge\" should also clear the current\nrerere state.  If (and this is a big if) \"git reset --merge\" should,\nprobably the right place to do so would be remove_branch_state(),\nbefore the function removes merge_rr file.  Doing so might allow us\nto lose calls to rerere_clear() individual codepaths of various\n\"abort\" implementations make, but that would certainly require\ncareful thinking to avoid unintended regressions.\n\n\n"},{"id":"350030","messageId":"CAD-Jur+CSfUASSFoXZndEoKvWoc3CU9+V3KrngANskFmQgwNhw@mail.gmail.com","threadId":"48695","inReplyTo":"xmqqr2lb9406.fsf@gitster-ct.c.googlers.com","subject":"Re: `git merge --abort` does not run `git rerere clear`","fromName":"Sam Kuper","fromEmail":"sam.kuper@uclmail.net","sentAt":"2018-06-12T22:35:30Z","receivedAt":"2018-06-12T22:35:35Z","isPatch":false,"sender":{"key":"sam.kuper@uclmail.net","avatar":"https://gravatar.com/avatar/ae189c4c56e5cd31dc7371016f169e68aef81a3ea3318041a1ca4be46f10435b?d=mp&s=160"},"body":"On 12/06/2018, Junio C Hamano <gitster@pobox.com> wrote:\n> Sam Kuper <sam.kuper@uclmail.net> writes:\n>> [...] It makes sense that `git am [--skip|--abort]` and `git rebase\n>> [--skip|--abort]` would run `git rerere clear`.\n>>\n>> However, if they run it, then shouldn't `git merge --abort` run it, too?\n>>\n>> If not, then what is the reason why not [...]\n>\n> I do not think there was any reason, other than that those who added\n> \"git merge --abort\" weren't as careful as they should have been ;-)\n\nThanks, good to know.\n\n> The command is a mere synonym to \"git reset --merge\";\n\nIndeed it seems so. Thank you for pointing this out.\n\n> I am not so\n> confident that \"git reset --merge\" should also clear the current\n> rerere state.  If (and this is a big if) \"git reset --merge\" should,\n> probably the right place to do so would be remove_branch_state(),\n> before the function removes merge_rr file.\n\nUnfortunately, I am still not familiar enough with the Git codebase to\nbe able to express an informed opinion about this. Sorry :(\n\n> Doing so might allow us\n> to lose calls to rerere_clear() individual codepaths of various\n> \"abort\" implementations make,\n\nThat, I think, was an example of a garden path sentence.[1] Took me\nmore than one parse to understand it :)\n\nAnyhow, yes, I agree that this might be an opportunity to DRY the\ncodebase in that regard. (And this would be a good thing, if so.)\n\n> but that would certainly require\n> careful thinking to avoid unintended regressions.\n\nI don't use `git reset --merge` often enough to have formed an opinion\nabout whether there are any use-cases for it in which it would be\ninappropriate for it to run `git rerere clear`. Apologies again not to\nbe able to be more helpful. I hope that you or others on the list will\nbe able to consider this matter, and the question of how/where to best\nimplement the change.\n\nThank you for your work maintaining Git!\n\n[1] https://en.wikipedia.org/wiki/Garden_path_sentence\n"}]}