Subject: Re: `git stash pop` UX Problem

From: Stephen Leake <[email-masked]>
Date: Tue, 25 Feb 2014 14:52:42 -0600

Matthieu Moy <[email-masked]> writes:

> Omar Othman <[email-masked]> writes:
>
>> [omar_othman main (trunk|MERGING*)]$ git add path/to/file.txt
>> [omar_othman main (trunk*)]$
>>
>> Note how the status message has changed to show that git is now happy.
>> It is at that moment that the stash reference should be dropped
>
> Dropping the stash on a "git add" operation would be really, really
> weird...

Why? That is when the merge conflicts are resolved, which is what
logically indicates that the stash is no longer needed, _if_ the merge
conflicts are related to the stash, which is true in this use case.

There are other uses for 'git add' that don't indicate that; we'd have
to be very careful to not throw away the stash at the wrong time.

>> (or the user (somehow) is notified to do that herself if desired),
>> because this means that the popping operation has succeeded.
>
> But how would you expect to "be notified"?

When 'git add' checks to see if all merge conflicts are now resolved,
and those merge conflicts were related to the stash, it can either pop
the stash, or issue a message telling the user it is now safe to do so.
We would need a config setting to indicate which to do.

Maybe that check is hard to do in general?

-- 
-- Stephe