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

Re: [PATCH] am: support --quit

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 14, 2018, 19:26 UTC
Message-ID
<xmqqy3jvmkyn.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<20180214111606.4257-1-pclouds@gmail.com>
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.

Show 6 quoted lines
>  --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.

Show 8 quoted lines
> @@ -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.

Previous: Nguyễn Thái Ngọc DuyNext: Duy Nguyen
Message 2 of 4 in “am: support --quit”
  1. am: support --quitNguyễn Thái Ngọc Duy, Feb 14, 2018
  2. Junio C HamanoFeb 14, 2018
  3. Duy NguyenFeb 23, 2018
  4. Junio C HamanoFeb 23, 2018

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.