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

Re: [RFC PATCH] stash: accept options also when subcommand 'save' is omitted

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Aug 18, 2009, 22:46 UTC
Message-ID
<alpine.DEB.1.00.0908190041200.8306@pacific.mpi-cbg.de>
In-Reply-To
<20090818223028.GB31176@coredump.intra.peff.net>
Hi,
On Tue, 18 Aug 2009, Jeff King wrote:
Show 21 quoted lines
> On Tue, Aug 18, 2009 at 11:42:58PM +0200, Johannes Schindelin wrote:
> 
> > > I think yours is nicer, especially as we have just added the 
> > > '-p|--patch' option, as well. With what is there now, you can do 
> > > "git stash -p", but not "git stash -p -k".
> > 
> > But it is sloppy, in that it blindly accepts options that might be 
> > valid for several subcommands, not just "save".
> > 
> > That was the reason I did not implement it this way.
> > 
> > But we do not have such ambiguous options yet.
> > 
> > Or do we?  Look at what "list" accepts!
> > 
> > So please register my objection.
> 
> I don't see the problem. Either the option works for "stash save" or it
> does not.  If I say "git stash --quiet", then it _must_ be "git stash
> save --quiet", and not "git stash pop --quiet", because "save" is the
> only default command.

So if I say "git stash -q" by mistake, but wanted to say "git stash drop -q", then I am borked?

Bah!  I say: bah!

You're basically reintroducing at least part of the DWIMery that was reverted in 9488e875 and I have the distinct feeling that some people in this thread do not think hard enough about what would adher to the principle of least surprise even in the future (or even for people introducing other stash save options).

Well, you just go ahead and push through your patch, and I do what I promised on my blog.

Previous: Jeff KingNext: Jeff King
Message 21 of 22 in “stash: accept options also when subcommand 'save' is omitted”
  1. stash: accept options also when subcommand 'save' is omittedMatthieu Moy, Aug 18, 2009
  2. Matthieu MoyAug 18, 2009
  3. Jeff KingAug 18, 2009
  4. Junio C HamanoAug 18, 2009
  5. 0/3 short syntaxes for 'git stash'Matthieu Moy, Aug 18, 2009
  6. 1/3 stash: accept -k as a shortcut for --keep-indexMatthieu Moy, Aug 18, 2009
  7. 2/3 stash: accept options also when subcommand 'save' is omittedMatthieu Moy, Aug 18, 2009
  8. 3/3 stash: reject stash name starting with a dash.Matthieu Moy, Aug 18, 2009
  9. Jeff KingAug 18, 2009
  10. Junio C HamanoAug 18, 2009
  11. Jeff KingAug 18, 2009
  12. Junio C HamanoAug 18, 2009
  13. Matthieu MoyAug 19, 2009
  14. Jeff KingAug 19, 2009
  15. Jeff KingAug 18, 2009
  16. Johannes SchindelinAug 18, 2009
  17. Matthieu MoyAug 18, 2009
  18. Johannes SchindelinAug 18, 2009
  19. Matthieu MoyAug 19, 2009
  20. Jeff KingAug 18, 2009
  21. Johannes SchindelinAug 18, 2009
  22. Jeff KingAug 18, 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.