git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Showing stash state in bash prompt

From
Jeff King <peff@peff.net>
Date
May 15, 2009, 02:11 UTC
Message-ID
<20090515021105.GA19241@coredump.intra.peff.net>
In-Reply-To
<buo1vqrqj2n.fsf@dhlpc061.dev.necel.com>
On Fri, May 15, 2009 at 09:57:20AM +0900, Miles Bader wrote:
Show 11 quoted lines
> 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
Previous: Miles BaderNext: John Tapsell
Message 7 of 13 in “Showing stash state in bash prompt”
  1. Showing stash state in bash promptDaniel Trstenjak, May 13, 2009
  2. Sverre RabbelierMay 13, 2009
  3. Daniel TrstenjakMay 13, 2009
  4. Junio C HamanoMay 13, 2009
  5. Thomas RastMay 14, 2009
  6. Miles BaderMay 15, 2009
  7. Jeff KingMay 15, 2009
  8. John TapsellMay 15, 2009
  9. Brian GernhardtMay 15, 2009
  10. Miles BaderMay 15, 2009
  11. Documentation: teach stash/pop workflow instead of stash/applyThomas Rast, May 28, 2009
  12. Sitaram ChamartyMay 29, 2009
  13. Junio C HamanoMay 29, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.