git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Miles Bader <miles@gnu.org>
Cc: Thomas Rast <trast@student.ethz.ch>,
	Daniel Trstenjak <Daniel.Trstenjak@science-computing.de>,
	Junio C Hamano <gitster@pobox.com>,
	git@vger.kernel.org, spearce@spearce.org
Subject: Re: [PATCH] Showing stash state in bash prompt
Date: Thu, 14 May 2009 22:11:05 -0400	[thread overview]
Message-ID: <20090515021105.GA19241@coredump.intra.peff.net> (raw)
In-Reply-To: <buo1vqrqj2n.fsf@dhlpc061.dev.necel.com>

On Fri, May 15, 2009 at 09:57:20AM +0900, Miles Bader wrote:

> Thomas Rast <trast@student.ethz.ch> writes:
> > But IMHO it would not be a good idea to teach people stash/pop anyway:
> > 'stash drop' is irreversible, because the stash is itself implemented
> > through the reflog and thus not guarded by one.
> 
> I don't understand why you say this -- sure "drop" is dangerous, but
> that's exactly why you should use "pop" instead, because it makes sure
> the changes are _somewhere_.  I found with the old (pre-"pop") stash,
> I'd often end up in a situation where I'd lose track of whether I had
> done a stash apply or not, and the risk of inadvertently doing a drop
> _without_ a corresponding apply was very real.

"pop" doesn't always succeed. If you have conflicts in applying, then
you end up with conflict markers, and the stash remains. You then fix up
and commit as you see fit, but your stash is still there. So this bash
prompt will nag you, which I think is what Thomas was complaining about
(but perhaps the nagging would then convince you to keep a cleaner stash
area by dropping the resolved stash).

-Peff

  reply	other threads:[~2009-05-15  2:13 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-13  9:44 [PATCH] Showing stash state in bash prompt Daniel Trstenjak
2009-05-13 10:53 ` Sverre Rabbelier
2009-05-13 11:25   ` Daniel Trstenjak
2009-05-13 19:14     ` Junio C Hamano
2009-05-14 18:24       ` Thomas Rast
2009-05-15  0:57         ` Miles Bader
2009-05-15  2:11           ` Jeff King [this message]
2009-05-15  6:39             ` John Tapsell
2009-05-15  7:01               ` Brian Gernhardt
2009-05-15  7:12                 ` Miles Bader
2009-05-28  9:40             ` [RFC PATCH] Documentation: teach stash/pop workflow instead of stash/apply Thomas Rast
2009-05-29  0:59               ` Sitaram Chamarty
2009-05-29  5:37               ` Junio C Hamano

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=20090515021105.GA19241@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=Daniel.Trstenjak@science-computing.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=miles@gnu.org \
    --cc=spearce@spearce.org \
    --cc=trast@student.ethz.ch \
    /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).