From: Jeff King <peff@peff.net>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: Matthieu Moy <Matthieu.Moy@imag.fr>, git@vger.kernel.org
Subject: Re: [RFC PATCH] stash: accept options also when subcommand 'save' is omitted
Date: Tue, 18 Aug 2009 19:06:32 -0400 [thread overview]
Message-ID: <20090818230632.GA4436@sigill.intra.peff.net> (raw)
In-Reply-To: <alpine.DEB.1.00.0908190041200.8306@pacific.mpi-cbg.de>
On Wed, Aug 19, 2009 at 12:46:27AM +0200, Johannes Schindelin wrote:
> 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!
Yep, though it is only one of many borkings that currently exist. Try:
# oops, what was the name of that option?
git stash save --index
# does apply take --patch, too?
git stash apply --patch
Still, other parts of the option parsing being awful aren't an excuse to
mess this one up. So I see your point.
> 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).
I don't think it is quite as bad as that, as arbitrary crap will not get
passed through, only crap that looks like options. Which is perhaps a
step up, but it is debatable how much.
I think Matthieu's proposal to be strict about matching the options, but
to take multiple options is probably the best bet for now. As it is now,
accepting "git stash -k" or "git stash -p" but not "git stash -k -p" is
pretty counterintuitive. But with explicit matching it should be no less
safe than it is now.
> Well, you just go ahead and push through your patch, and I do what I
> promised on my blog.
I don't know why you need to be so confrontational. I don't even have a
patch to "push through". I just said "I don't see the problem", and I'm
glad you brought up the previous stash behavior, because I had forgotten
the pain it caused. And that is why discussing on a public forum is
nice; it lets people contribute things that others might have missed.
-Peff
prev parent reply other threads:[~2009-08-18 23:06 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-18 12:46 [RFC PATCH] stash: accept options also when subcommand 'save' is omitted Matthieu Moy
2009-08-18 13:01 ` Matthieu Moy
2009-08-18 17:45 ` Jeff King
2009-08-18 20:20 ` Junio C Hamano
2009-08-18 21:38 ` [PATCH 0/3] short syntaxes for 'git stash' Matthieu Moy
2009-08-18 21:38 ` [PATCH 1/3] stash: accept -k as a shortcut for --keep-index Matthieu Moy
2009-08-18 21:38 ` [PATCH 2/3] stash: accept options also when subcommand 'save' is omitted Matthieu Moy
2009-08-18 21:38 ` [PATCH 3/3] stash: reject stash name starting with a dash Matthieu Moy
2009-08-18 23:35 ` Jeff King
2009-08-18 23:45 ` Junio C Hamano
2009-08-18 23:54 ` Jeff King
2009-08-18 23:55 ` Junio C Hamano
2009-08-19 6:57 ` Matthieu Moy
2009-08-19 9:57 ` Jeff King
2009-08-18 23:31 ` [PATCH 0/3] short syntaxes for 'git stash' Jeff King
2009-08-18 21:42 ` [RFC PATCH] stash: accept options also when subcommand 'save' is omitted Johannes Schindelin
2009-08-18 21:52 ` Matthieu Moy
2009-08-18 22:37 ` Johannes Schindelin
2009-08-19 7:14 ` Matthieu Moy
2009-08-18 22:30 ` Jeff King
2009-08-18 22:46 ` Johannes Schindelin
2009-08-18 23:06 ` Jeff King [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090818230632.GA4436@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=Johannes.Schindelin@gmx.de \
--cc=Matthieu.Moy@imag.fr \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).