git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Sam Kuper <sam.kuper@uclmail.net>
Cc: git@vger.kernel.org
Subject: Re: `git merge --abort` does not run `git rerere clear`
Date: Tue, 12 Jun 2018 12:52:25 -0700	[thread overview]
Message-ID: <xmqqr2lb9406.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <CAD-JurLXh=rOC=bhjTa8jCpeDWkbDhCztSpjLuMEUGm1-QnAiw@mail.gmail.com> (Sam Kuper's message of "Tue, 12 Jun 2018 20:32:28 +0100")

Sam Kuper <sam.kuper@uclmail.net> writes:

> `man git-rerere` says:
>
>> clear
>>
>> Reset the metadata used by rerere if a merge resolution is to be
>> aborted. Calling git am [--skip|--abort] or git rebase
>> [--skip|--abort] will automatically invoke this command.
>
> It makes sense that `git am [--skip|--abort]` and `git rebase
> [--skip|--abort]` would run `git rerere clear`.
>
> However, if they run it, then shouldn't `git merge --abort` run it, too?
>
> If not, then what is the reason why not, and might it be helpful for
> this reason to be mentioned at some appropriate place in the
> documentation?

I do not think there was any reason, other than that those who added
"git merge --abort" weren't as careful as they should have been ;-)

The command is a mere synonym to "git reset --merge"; I am not so
confident that "git reset --merge" should also clear the current
rerere state.  If (and this is a big if) "git reset --merge" should,
probably the right place to do so would be remove_branch_state(),
before the function removes merge_rr file.  Doing so might allow us
to lose calls to rerere_clear() individual codepaths of various
"abort" implementations make, but that would certainly require
careful thinking to avoid unintended regressions.



  reply	other threads:[~2018-06-12 19:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-12 19:32 `git merge --abort` does not run `git rerere clear` Sam Kuper
2018-06-12 19:52 ` Junio C Hamano [this message]
2018-06-12 22:35   ` Sam Kuper

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqr2lb9406.fsf@gitster-ct.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=sam.kuper@uclmail.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).