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

Re: git-stash: RFC: Adopt the default behavior to other commands

From
Martin Langhoff <martin.langhoff@gmail.com>
Date
Dec 19, 2007, 07:46 UTC
Message-ID
<46a038f90712182346t5309448egebfd3726f4d493c5@mail.gmail.com>
In-Reply-To
<38C1471E-0927-4B43-AF73-70735820F8F9@wincent.com>
On Dec 19, 2007 8:33 PM, Wincent Colaiuta <win@wincent.com> wrote:
Show 11 quoted lines
> El 19/12/2007, a las 0:41, Martin Langhoff escribió:
>
> > On Dec 19, 2007 4:42 AM, Jörg Sommer <joerg@alea.gnuu.de> wrote:
> >> I vote for stash print the list, because I dropped in the pitfall.
> >
> > I've dropped there myself, and work with a large team where we are
> > both fans of stash, and scarred by it. Any newcomer to git that
> > "discovers" stash gets hit by it a dozen times, this is completely
> > unnecesary.
>
> I may be missing something here, but what's the danger here? An

Surprise. Your working directory has *just* changed under your feet. Maybe you have an editor with further unsaved changes that is about to act confused whether you undo the stash or not.

> unexpected stash is incredibly easy to revert, unless I'm missing

Once you know about it, yes it is. Once you know about the reflog, you can sing and dance and never be worried. But for starting users, it's a dangerous command.

> And nobody commented on the idea I posted earlier which
> seems to address the concerns about newbies not knowing what "git
> stash" with no params does:

I agree with making stash more verbose -- if the unlucky new user is paying close attention, they'll have instructions on to how to get out of trouble. But I agree more with making it "just verbose, no action" by default. There are two strong hints:

 - all other state-changing commands take parameters
 - quite a few people in this list have gotten burned with it

Even after knowing pretty well how stash works, I still get mixed up sometimes with the 'clear/clean/list' stuff. Or have a typo in the command.

cheers,
martin
Previous: Wincent ColaiutaNext: Andreas Ericsson
Message 30 of 33 in “git-stash: RFC: Adopt the default behavior to other commands”
  1. Sebastian HarlDec 17, 2007
  2. Benoit SigoureDec 17, 2007
  3. Junio C HamanoDec 17, 2007
  4. Benoit SigoureDec 17, 2007
  5. Junio C HamanoDec 18, 2007
  6. Sebastian HarlDec 18, 2007
  7. Johannes SchindelinDec 18, 2007
  8. Andreas EricssonDec 18, 2007
  9. Johannes SchindelinDec 18, 2007
  10. Andreas EricssonDec 18, 2007
  11. Johannes SchindelinDec 18, 2007
  12. Andreas EricssonDec 18, 2007
  13. Jakub NarebskiDec 18, 2007
  14. Andreas EricssonDec 18, 2007
  15. Johannes SchindelinDec 18, 2007
  16. Sergei OrganovDec 18, 2007
  17. Johannes SchindelinDec 18, 2007
  18. Martin LanghoffDec 18, 2007
  19. Wincent ColaiutaDec 18, 2007
  20. Jörg SommerDec 18, 2007
  21. Johannes SchindelinDec 18, 2007
  22. Junio C HamanoDec 18, 2007
  23. しらいしななこDec 20, 2007
  24. Junio C HamanoDec 20, 2007
  25. Wincent ColaiutaDec 21, 2007
  26. しらいしななこDec 21, 2007
  27. André Goddard RosaDec 18, 2007
  28. Martin LanghoffDec 18, 2007
  29. Wincent ColaiutaDec 19, 2007
  30. Martin LanghoffDec 19, 2007
  31. Andreas EricssonDec 19, 2007
  32. Johannes SchindelinDec 19, 2007
  33. Wincent ColaiutaDec 19, 2007

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.