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

Re: Usability of git stash

From
Brandon Casey <casey@nrlssc.navy.mil>
Date
Oct 16, 2008, 15:22 UTC
Message-ID
<vCcONcOJu3QKQyRgPdT5Dws3F2P25RNAFOgM5GX6FWWKJe40papCRw@cipher.nrlssc.navy.mil>
In-Reply-To
<86vdvsg4up.fsf@lola.quinscape.zz>
David Kastrup wrote:
Show 12 quoted lines
> Brandon Casey <casey@nrlssc.navy.mil> writes:
> 
>> Anders Melchiorsen wrote:
>>
>>> When trying to recover from that scenario, I do "git stash apply" as
>>> recommended by the "git stash" output. Now I still lost my index
>>> state, all changes are unstaged.
>> See the documentation, apply has a '--index' option.
> 
> Still, the shoot-yourself-in-the-foot potential is quite larger than
> appropriate for what is mostly workflow porcelaine.  It is even larger
> than appropriate for plumbing IMHO.

I think it is excessive to call the action taken by 'git stash', when it is unwanted, "shoot[ing]-yourself-in-the-foot". More like stub-your-toe.

In exchange for allowing new users to stub their toe on new commands, the work flow of more experienced users is made a little easier.

Show 5 quoted lines
> I mean, even misspellings like
> git stash lisp
>
> cause action that is not easily reversible, and the given help output is
> misleading with regard to index state.
$ git stash lisp
Usage: git stash list [<options>]
   or: git stash (show | drop | pop ) [<stash>]
   or: git stash apply [--index] [<stash>]
   or: git stash branch <branchname> [<stash>]
   or: git stash [save [--keep-index] [<message>]]
   or: git stash clear

Maybe you are referring to the long since changed behavior where 'git stash' == 'git stash save' and so "lisp" in your example would have been taken as a stash description. This behavior existed for less than 6 months, and has been changed now for over 10 months.

-brandon
Previous: David KastrupNext: Anders Melchiorsen
Message 4 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.