From: Junio C Hamano <gitster@pobox.com>
To: Tao Klerks <tao@klerks.biz>
Cc: git <git@vger.kernel.org>
Subject: Re: Introduce "git stash --continue" and "git stash --abort"?
Date: Thu, 02 Jun 2022 11:30:38 -0700 [thread overview]
Message-ID: <xmqq5ylior3l.fsf@gitster.g> (raw)
In-Reply-To: <CAPMMpohvKSgcL=X=Z=Wf7zHRr_Ghex5oZ4iUTgZL7XhHSWFi8g@mail.gmail.com> (Tao Klerks's message of "Thu, 2 Jun 2022 18:40:09 +0200")
Tao Klerks <tao@klerks.biz> writes:
> I would expect that some sort of merge- or rebase-like "--continue or
> --abort" facility would make this much easier to understand... but of
> course I have no idea how one would go about doing that. I assume the
> closest existing pattern would be "git cherry-pick", but I imagine I'm
> missing lots of subtleties.
> ...
> Is this kind of direction one that's been considered before? Are there
> reasons why it's a bad idea?
I saw a few exchange on the intended use of "stash" on another
thread in the past days, but I think the reason why the current
set of defaults and behaviour are appropriate for "stash" is related
to it.
The intended use of "stash" is to clear the deck as quickly as
possible to deal with "emergencies", and its behaviour comes from
the need to support that use case effectively. Untracked cruft are
often useful even when you do a "quick context switch" (aka "the
boss suddenly appears and asks you to do something different real
quick"), hence "-u" is not the default, for example. "stash pop"
was the primary way to go back to where you were before the
interruption, and such going back is expected to be done after the
crisis is over when you can be more relaxed, and was expected to be
done _after_ you "reset --hard" and/or "git switch" out of the
crisis mode. And the natural way to recover from "eh, I moved back
to a different commit---I wanted to go to the commit I was when I
saved the stash" was "reset --hard" that would not lose anything new
(and "stash branch" was later added to make the last one easier to
do), for another example.
Users are better off doing any large scale "I made a mess in the
working tree with mixed changes, and I want to take time to separate
them out" on separate (possibly temporary) branches, instead of
using "stash save" + "stash pop". Any change that would make it
more cumbersome for the primary intended purpose of "quick save"
would be very much unwelcome, I would have to say.
Thanks.
next prev parent reply other threads:[~2022-06-02 18:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-02 16:40 Introduce "git stash --continue" and "git stash --abort"? Tao Klerks
2022-06-02 18:30 ` Junio C Hamano [this message]
2022-06-03 8:29 ` Tao Klerks
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=xmqq5ylior3l.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=tao@klerks.biz \
/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).