git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: Matthieu Moy <Matthieu.Moy@imag.fr>,
	git@vger.kernel.org,
	Johannes Schindelin <johannes.schindelin@gmx.de>
Subject: Re: [RFC PATCH] stash: accept options also when subcommand 'save' is omitted
Date: Tue, 18 Aug 2009 13:20:03 -0700	[thread overview]
Message-ID: <7vbpmcc1sc.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: 20090818174509.GA27518@coredump.intra.peff.net

Jeff King <peff@peff.net> writes:

> On Tue, Aug 18, 2009 at 03:01:52PM +0200, Matthieu Moy 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 I may have missed its drawbacks ;-)
>
> The only I can think of is that bogus input will provoke 'save'. So
> something like:
>
>   git stash --apply
>
> will invoke "git stash save --apply", which doesn't even complain. It
> just tries to make a stash with message --apply. Now of course this
> input is obviously bogus, but probably the right thing to do is
> complain.
>
> OTOH, I think it is the fault of "git stash save --apply" for not doing
> the complaining, so your patch really isn't making it worse. Probably it
> should barf on anything unrecognized starting with a '-', and allow '--'
> to separate the message from the rest of the options (in the rare case
> that you want a message starting with '-').

Sounds like a sane approach.

I am Ok with the idea of queuing a patch to update js/stash-dwim ea41cfc
(Make 'git stash -k' a short form for 'git stash save --keep-index',
2009-07-27) with an implementation along this line; the "stash -p" one
f300fab (DWIM 'git stash save -p' for 'git stash -p', 2009-08-13) also
may need to adjusted (it could become no-op, I suspect).

  reply	other threads:[~2009-08-18 20:20 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 [this message]
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

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=7vbpmcc1sc.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=Matthieu.Moy@imag.fr \
    --cc=git@vger.kernel.org \
    --cc=johannes.schindelin@gmx.de \
    --cc=peff@peff.net \
    /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).