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

Re: Usability of git stash

From
Stephan Beyer <s-beyer@gmx.net>
Date
Oct 19, 2008, 23:12 UTC
Message-ID
<20081019231239.GA23692@leksak.fem-net>
In-Reply-To
<20081019184029.GF14786@spearce.org>
Hi,
Shawn O. Pearce wrote:
Show 16 quoted lines
> Personally I wish git-stash wasn't invented the way it is.  I would
> have rather seen it as macros to do a quick:
> 
> 	git commit -m wip-index-state
> 	git commit -A -m wip-worktree-state
> 
> and unwind it with essentially:
> 
> 	git reset --mixed HEAD^
> 	git reset --soft HEAD^
> 
> then its a lot less black magic to users, as they can see it in the
> DAG, and its more explicitly tied to the branch they were on at the
> time they ran the stash.  I think its rare you'd stash something
> then switch to another branch to apply it.  But that could easily
> be done with cherry-pick.

Just a side note: I, for example, have a stash in which some "valgrind ..." string is prepended to some lines in some test scripts. I apply the stash on different branches and after testing I reset the file (or checkout -f another branch). I never really want to commit these changes.

So, the alternative for this use case (if there was no git-stash) is to have a "valgrind" branch somewhere and do some "cherry-pick -n" of those commits, right?

Hmm, it seems that this is the better way in the long run. But "git-stash" seemed to be the natural way at first.

Regards,
  Stephan
-- 
Stephan Beyer <s-beyer@gmx.net>, PGP 0x6EDDD207FCC5040F
Previous: Shawn O. PearceNext: Miles Bader
Message 9 of 15 in “Usability of git stash”
  1. Anders MelchiorsenOct 15, 2008
  2. Brandon CaseyOct 15, 2008
  3. David KastrupOct 16, 2008
  4. Brandon CaseyOct 16, 2008
  5. Anders MelchiorsenOct 18, 2008
  6. Shawn O. PearceOct 19, 2008
  7. Leo RazoumovOct 19, 2008
  8. Shawn O. PearceOct 19, 2008
  9. Stephan BeyerOct 19, 2008
  10. Miles BaderOct 20, 2008
  11. Jeff KingOct 20, 2008
  12. Junio C HamanoOct 20, 2008
  13. Miles BaderOct 20, 2008
  14. Andreas EricssonOct 20, 2008
  15. Brandon CaseyOct 20, 2008

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.