Re: [RFC][PATCH] git-stash: convert git stash list to C builtin
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Mar 26, 2018, 19:03 UTC
- Message-ID
- <nycvar.QRO.7.76.6.1803262058490.77@ZVAVAG-6OXH6DA.rhebcr.pbec.zvpebfbsg.pbz>
- In-Reply-To
- <CAPig+cS9QwCOG7BA7O5Nu_zsh-xTbDFy2vTWpAXxBuKTY-uzUw@mail.gmail.com>
Hi Eric,
On Sun, 25 Mar 2018, Eric Sunshine wrote:
Show 22 quoted lines
> 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 formWhy not start with cmdmode, and then add a single patch that *also* accepts argv[1] as a bare-word cmdmode?
This could even potentially be a patch to parse-options.[ch] that introduces, say, PARSE_OPT_ALLOW_BARE_CMDMODE.
Ciao, Dscho