From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: "Shawn O. Pearce" <spearce@spearce.org>,
Anders Melchiorsen <mail@cup.kalibalik.dk>,
Brandon Casey <casey@nrlssc.navy.mil>,
David Kastrup <dak@gnu.org>,
git@vger.kernel.org
Subject: Re: Usability of git stash
Date: Sun, 19 Oct 2008 22:29:39 -0700 [thread overview]
Message-ID: <7vmygz4yws.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <20081020003644.GA10412@coredump.intra.peff.net> (Jeff King's message of "Sun, 19 Oct 2008 20:36:44 -0400")
Jeff King <peff@peff.net> writes:
> git checkout next ;# which is where I usually am anyway
> hack hack hack
> # oops, I have been building this directly on top of next and it
> # really needs to be a feature-branch on maint
> git stash
> git checkout -b jk/maint-fix-whatever origin/maint
> git stash apply
>
> The equivalent non-stash commands would be "commit -m wip" and
> "cherry-pick". But the stash saves me the trouble later of having to
> delete the wip cruft on top of next.
The equivalent would be:
git checkout -m -b jk/maint-fix-whatever origin/maint
no need for stash, wip-commit, nor cherry-pick.
The advantage of using "stash then stash apply" (not "stash pop") or
"wip-commit with cherry-pick" is that you can reset, take a deep breath,
and redo it, when the resulting merge conflict gets too hairy.
> I disagree. I think the strength of stash is that it is divorced from
> the history. So it is more like a cherry-pick (or diff | apply, which is
> what it was intended to replace).
I agree with you; it really is the "diff saved somewhere, later applied".
next prev parent reply other threads:[~2008-10-20 5:31 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-15 19:24 Usability of git stash Anders Melchiorsen
2008-10-15 19:31 ` Brandon Casey
2008-10-16 11:24 ` David Kastrup
2008-10-16 15:22 ` Brandon Casey
2008-10-18 9:26 ` Anders Melchiorsen
2008-10-19 18:40 ` Shawn O. Pearce
2008-10-19 21:08 ` Leo Razoumov
2008-10-19 21:49 ` Shawn O. Pearce
2008-10-19 23:12 ` Stephan Beyer
2008-10-20 9:36 ` Miles Bader
2008-10-20 0:36 ` Jeff King
2008-10-20 5:29 ` Junio C Hamano [this message]
2008-10-20 5:23 ` Miles Bader
2008-10-20 9:49 ` Andreas Ericsson
2008-10-20 16:33 ` Brandon Casey
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=7vmygz4yws.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=casey@nrlssc.navy.mil \
--cc=dak@gnu.org \
--cc=git@vger.kernel.org \
--cc=mail@cup.kalibalik.dk \
--cc=peff@peff.net \
--cc=spearce@spearce.org \
/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).