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

Re: [PATCH] rebase: save autostash entry into stash reflog on --quit

From
Denton Liu <liu.denton@gmail.com>
Date
Apr 29, 2020, 00:23 UTC
Message-ID
<20200429002323.GB2570028@generichostname>
In-Reply-To
<xmqqv9lj1k0c.fsf@gitster.c.googlers.com>
Hi Junio,
On Tue, Apr 28, 2020 at 12:35:15PM -0700, Junio C Hamano wrote:
Show 17 quoted lines
> > diff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt
> > index f7a6033607..7d0c89a184 100644
> > --- a/Documentation/git-rebase.txt
> > +++ b/Documentation/git-rebase.txt
> > @@ -256,7 +256,8 @@ See also INCOMPATIBLE OPTIONS below.
> >  --quit::
> >  	Abort the rebase operation but HEAD is not reset back to the
> >  	original branch. The index and working tree are also left
> > -	unchanged as a result.
> > +	unchanged as a result. If a temporary stash entry was created
> > +	using --autostash, it will be saved to the stash reflog.
> 
> ... let's not do so for end-user facing documentation.  "..., it
> will be stashed away".  Or we may not even want to say anything; any
> "--autostash" user would expect that the changes that were stashed
> before "rebase" started would not be discarded, and this change may
> just be a bugfix.

Hmm, in this case, git-merge.txt may need an update as well. From 'dl/merge-autostash',

	'git merge --abort' is equivalent to 'git reset --merge' when
	`MERGE_HEAD` is present unless `MERGE_AUTOSTASH` is also present in
	which case 'git merge --abort' applies the stash entry to the worktree
	whereas 'git reset --merge' will save the stashed changes in the stash
	reflog.
and
	--quit::
		Forget about the current merge in progress. Leave the index
		and the working tree as-is. If `MERGE_AUTOSTASH` is present, the
		stash entry will be saved to the stash reflog.
both need to be amended to remove the reference to the "stash reflog".

When I was writing this documentation, I wanted to distinguish between the temporary autostash entry and the actual stash since the autostash entry isn't pushed to the stash unless there are conflicts or it's explicitly saved. I'm not sure that something like "If a temporary stash entry was created using --autostash, it will be stashed away" works very well since the word "stash" is overloaded here to mean "a random stash commit" and "stashed away in _the_ stash". Unfortunately, I'm also having trouble coming up with a suitable phrasing of my own.

I dunno, perhaps I'm overthinking this too and your suggested rewording sounds good and I'm just being too picky.

Thanks,
Denton
Previous: Junio C HamanoNext: Phillip Wood
Message 3 of 5 in “rebase: save autostash entry into stash reflog on --quit”
  1. rebase: save autostash entry into stash reflog on --quitDenton Liu, Apr 28, 2020
  2. Junio C HamanoApr 28, 2020
  3. Denton LiuApr 29, 2020
  4. Phillip WoodApr 30, 2020
  5. Phillip WoodApr 30, 2020

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.