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

Re: stash refuses to pop

From
Johannes Sixt <j.sixt@viscovery.net>
Date
Apr 12, 2012, 05:50 UTC
Message-ID
<4F866D0D.7070904@viscovery.net>
In-Reply-To
<4F859353.4070700@ubuntu.com>
Am 4/11/2012 16:21, schrieb Phillip Susi:
Show 6 quoted lines
> On 4/11/2012 1:58 AM, Johannes Sixt wrote:
>> You are trying to abuse git-stash, but it does not cooperate because it
>> was not designed to be abused ;-) git-stash is not intended as a generic
>> push-and-pop-my-changes work horse.
> 
> In what way is using the documented -p switch abuse?
It isn't.
>> The purpose of git-stash is that you can "move away"
> 
> Yes, and then move back.
This is abuse, if you haven't cleaned your worktree.
Show 7 quoted lines
>> That is, before you can think of applying a stash, you are expected to
>> have cleaned out your worktree.
> 
> It is obvious that is the assumption that stash was originally made with,
> and it might make some sense if it always left the tree in a clean state,
> but it no longer makes sense given -p and how it can leave the tree in a
> not clean state.
You are misunderstanding. The intended workflow is:
  stash -p
  # ... test the remaining changes in isolation ...
  commit -a
  # now the worktree is clean
  stash pop
-- Hannes
Previous: Phillip Susi
Message 12 of 12 in “stash refuses to pop”
  1. Phillip SusiApr 10, 2012
  2. Junio C HamanoApr 10, 2012
  3. Phillip SusiApr 10, 2012
  4. Andrew ArdillApr 11, 2012
  5. Phillip SusiApr 11, 2012
  6. Andreas KreyApr 14, 2012
  7. Jakub NarebskiApr 14, 2012
  8. Phillip SusiApr 16, 2012
  9. Victor EngmarkApr 11, 2012
  10. Johannes SixtApr 11, 2012
  11. Phillip SusiApr 11, 2012
  12. Johannes SixtApr 12, 2012

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.