From: Thomas Gummerer <t.gummerer@gmail.com>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: Eric Sunshine <sunshine@sunshineco.com>,
Paul-Sebastian Ungureanu <ungureanupaulsebastian@gmail.com>,
Git List <git@vger.kernel.org>
Subject: Re: [RFC][PATCH] git-stash: convert git stash list to C builtin
Date: Mon, 26 Mar 2018 21:58:31 +0100 [thread overview]
Message-ID: <20180326205831.GG10909@hank> (raw)
In-Reply-To: <nycvar.QRO.7.76.6.1803262058490.77@ZVAVAG-6OXH6DA.rhebcr.pbec.zvpebfbsg.pbz>
On 03/26, Johannes Schindelin wrote:
> Hi Eric,
>
> On Sun, 25 Mar 2018, Eric Sunshine wrote:
>
> > On Sat, Mar 24, 2018 at 2:23 PM, Paul-Sebastian Ungureanu
> > <ungureanupaulsebastian@gmail.com> wrote:
> > > Currently, because git stash is not fully converted to C, I
> > > introduced a new helper that will hold the converted commands.
> > > ---
> > > diff --git a/builtin/stash--helper.c b/builtin/stash--helper.c
> > > @@ -0,0 +1,52 @@
> > > +int cmd_stash__helper(int argc, const char **argv, const char *prefix)
> > > +{
> > > + int cmdmode = 0;
> > > +
> > > + struct option options[] = {
> > > + OPT_CMDMODE(0, "list", &cmdmode,
> > > + N_("list stash entries"), LIST_STASH),
> > > + OPT_END()
> > > + };
> >
> > Is the intention that once git-stash--helper implements all 'stash'
> > functionality, you will simply rename git-stash--helper to git-stash?
> > If so, then I'd think that you'd want it to accept subcommand
> > arguments as bare words ("apply", "drop") in order to be consistent
> > with the existing git-stash command set, not in dashed form
>
> Why not start with cmdmode, and then add a single patch that *also*
> accepts argv[1] as a bare-word cmdmode?
I don't think we should accept the dashed form of the commands for
'git stash'. The main reason being that we also have 'git stash'
without any arguments, which acts as 'git stash push'. So if we would
ever come up with an argument to 'git stash push', that matches one of
the current verbs, or if we come up with a new verb that matches one
of the options to 'git stash push', that would not work.
In that case we could obviously go for a different word, but I think
the rules when 'git stash' is going to be 'git stash push' and when it
is not are already complicated enough, and allowing the verbs as
dashed options would only make the interface more complicated.
> This could even potentially be a patch to parse-options.[ch] that
> introduces, say, PARSE_OPT_ALLOW_BARE_CMDMODE.
Now if we'd take that one step further and make it
PARSE_OPT_BARE_CMDMODE, which would only allow the non-dashed options,
I think we could use that in other places in git as well (for example
in 'git worktree').
> Ciao,
> Dscho
next prev parent reply other threads:[~2018-03-26 20:55 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-24 18:23 [RFC][PATCH] git-stash: convert git stash list to C builtin Paul-Sebastian Ungureanu
2018-03-25 7:08 ` Eric Sunshine
2018-03-26 19:03 ` Johannes Schindelin
2018-03-26 20:58 ` Thomas Gummerer [this message]
2018-03-30 10:29 ` Johannes Schindelin
2018-04-03 21:38 ` Paul-Sebastian Ungureanu
2018-04-07 8:56 ` Eric Sunshine
2018-04-07 8:58 ` Eric Sunshine
2018-03-25 18:43 ` Thomas Gummerer
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=20180326205831.GG10909@hank \
--to=t.gummerer@gmail.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=sunshine@sunshineco.com \
--cc=ungureanupaulsebastian@gmail.com \
/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).