From: Junio C Hamano <gitster@pobox.com>
To: Denton Liu <liu.denton@gmail.com>
Cc: Git Mailing List <git@vger.kernel.org>,
Phillip Wood <phillip.wood123@gmail.com>
Subject: Re: [PATCH] rebase: save autostash entry into stash reflog on --quit
Date: Tue, 28 Apr 2020 12:35:15 -0700 [thread overview]
Message-ID: <xmqqv9lj1k0c.fsf@gitster.c.googlers.com> (raw)
In-Reply-To: <353a67567a90aea8a90bce1de05d005c61b3b670.1588066252.git.liu.denton@gmail.com> (Denton Liu's message of "Tue, 28 Apr 2020 05:31:31 -0400")
Denton Liu <liu.denton@gmail.com> writes:
> In a03b55530a (merge: teach --autostash option, 2020-04-07), the
> --autostash option was introduced for `git merge`. Notably, when
> `git merge --quit` is run with an autostash entry present, it is saved
> into the stash reflog. This is contrasted with the current behaviour of
> `git rebase --quit` where the autostash entry is simply just dropped out
> of existence.
>
> Adopt the behaviour of `git merge --quit` in `git rebase --quit` and
> save the autostash entry into the stash reflog instead of just deleting
> it.
The goal is wrothy, I would think, but I do not think we would
explain it in terms of "stash reflog". It is true that what "stash
list" shows, the list of stasn entries, happens to be implemented as
reflog entries of a single ref, but the end users would not view
them as reflog entries, I suspect. Do you know anybody who would do
"git reflog stash@{now}"?
It is less bad to explain with "reflog of stash ref" in the log
message, meant to be read by our future developers, but ...
> 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.
> diff --git a/builtin/rebase.c b/builtin/rebase.c
> index bc4fc69906..71aec532b1 100644
> --- a/builtin/rebase.c
> +++ b/builtin/rebase.c
> @@ -1556,6 +1556,7 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
> goto cleanup;
> }
> case ACTION_QUIT: {
> + save_autostash(state_dir_path("autostash", &options));
> if (options.type == REBASE_MERGE) {
> struct replay_opts replay = REPLAY_OPTS_INIT;
Nice to see a fix as simple a this one ;-)
next prev parent reply other threads:[~2020-04-28 19:35 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-28 9:31 [PATCH] rebase: save autostash entry into stash reflog on --quit Denton Liu
2020-04-28 19:35 ` Junio C Hamano [this message]
2020-04-29 0:23 ` Denton Liu
2020-04-30 9:45 ` Phillip Wood
2020-04-30 9:41 ` Phillip Wood
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=xmqqv9lj1k0c.fsf@gitster.c.googlers.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=liu.denton@gmail.com \
--cc=phillip.wood123@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).