All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Stephan Beyer <s-beyer@gmx.net>
Cc: git <git@vger.kernel.org>
Subject: Re: [RFC] stash --continue
Date: Tue, 17 Jan 2017 12:21:10 -0800	[thread overview]
Message-ID: <xmqqy3y9e8uh.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <cd784a4e-ee99-564e-81de-9f7f6cc26c67@gmx.net> (Stephan Beyer's message of "Mon, 16 Jan 2017 00:56:00 +0100")

Stephan Beyer <s-beyer@gmx.net> writes:

> This led to the idea to have something like "git stash --continue"[1]
> that would expect the user to "git add" the resolved files (as "git
> status" suggests) but then leads to the expected result, i.e. the index
> being the same as before the conflict, the stash being dropped (if "pop"
> was used instead of "apply"), etc.
>
> Likewise, some "git stash --abort"[2] might be useful in case you did
> "git stash pop" with the wrong stash in mind.
>
> What do you think about that?

"git stash pop --continue" (and "git stash apply --continue") would
make quite a lot of sense.  I like it very much primarily because it
will give us an opportunity to correct a major UI glitches around
applying stashed changes to the working tree.

Don't people find it strange that "stash pop" that applies cleanly
would not touch the index, leaving (an equivalent of) the changes
stashed earlier floating in the working tree, but "stash pop" that
conflicts and needs a three-way merge touches the index and the
usual way of concluding the manual conflict resolution is "git add"
the paths, meaning that the changes that were not ready hence
floating in the working tree back when the stash was made goes into
the index when the user concludes "stash pop"?

With an explicit "--continue", we can fix that so that we reset the
index to the HEAD.  That way, whether the changes have conflict with
the HEAD's tree or not, the end user after "stash pop" will see the
changes in the working tree and "git diff" (no HEAD argument or
"--cached" option) will consistently show what came from the stash.

      parent reply	other threads:[~2017-01-17 20:26 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-15 23:56 [RFC] stash --continue Stephan Beyer
2017-01-16  3:59 ` Jacob Keller
2017-01-16 10:54 ` Johannes Schindelin
2017-01-18 15:41   ` Marc Branchaud
2017-01-18 16:34     ` Johannes Schindelin
2017-01-18 18:44       ` Marc Branchaud
2017-01-18 19:35         ` Samuel Lijin
2017-01-19 15:49         ` Johannes Schindelin
2017-01-19 18:38           ` Marc Branchaud
2017-01-19 21:30             ` Johannes Schindelin
2017-01-20 15:19               ` Marc Branchaud
2017-01-20 15:27                 ` Johannes Schindelin
2017-01-18 19:10       ` Junio C Hamano
2017-01-18 19:20     ` Stephan Beyer
2017-01-19 15:54       ` Johannes Schindelin
2017-01-17 20:21 ` Junio C Hamano [this message]

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=xmqqy3y9e8uh.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=s-beyer@gmx.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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.