git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] am: support --quit
Date: Wed, 14 Feb 2018 11:26:24 -0800	[thread overview]
Message-ID: <xmqqy3jvmkyn.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <20180214111606.4257-1-pclouds@gmail.com> ("Nguyễn Thái Ngọc Duy"'s message of "Wed, 14 Feb 2018 18:16:06 +0700")

Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:

> Among the "in progress" commands, only git-am and git-merge do not
> support --quit. Support --quit in git-am too.

That's a strange way to phrase it, when the number of commands that
know and do not know it are about the same.

>  --abort::
>  	Restore the original branch and abort the patching operation.
>  
> +--quit::
> +	Abort the patching operation but keep HEAD and the index
> +	untouched.

OK, I see from the documentation of rebase that the above pair is
consistent with how --abort/--quit are done over there.

> @@ -2359,6 +2363,10 @@ int cmd_am(int argc, const char **argv, const char *prefix)
>  	case RESUME_ABORT:
>  		am_abort(&state);
>  		break;
> +	case RESUME_QUIT:
> +		am_rerere_clear();
> +		am_destroy(&state);
> +		break;

The internal implementation detail of am_abort() is leaking out
here, by saying "rerere-clear" is the only special thing other than
recovering the HEAD and working tree state when abort happens.  It
makes readers wonder if am_rerere_clear() should become part of
am_destroy().  I dunno.

  reply	other threads:[~2018-02-14 19:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-14 11:16 [PATCH] am: support --quit Nguyễn Thái Ngọc Duy
2018-02-14 19:26 ` Junio C Hamano [this message]
2018-02-23 10:24   ` Duy Nguyen
2018-02-23 18:00     ` Junio C Hamano

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

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

  git send-email \
    --in-reply-to=xmqqy3jvmkyn.fsf@gitster-ct.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=pclouds@gmail.com \
    /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.
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 NNTP newsgroup(s).