Re: [PATCH 4/6] [GSOC] ref-filter: add %(rest) atom and --rest option
- From
ZheNing Hu <adlternative@gmail.com>
- Date
- Jun 6, 2021, 04:58 UTC
- Message-ID
- <CAOLTT8RD1hmjiusDuf_O+UPBH0H9-2Y58LFd_UcvnZ2R5zL08w@mail.gmail.com>
- In-Reply-To
- <CA+CkUQ9f8kN=S8dU_zt=-uG1pcK8cE9CuhJdqR9oMwcguZ9FLg@mail.gmail.com>
Hi,
Hariom verma <hariom18599@gmail.com> 于2021年6月5日周六 下午11:20写道:
Show 23 quoted lines
>
> Hi,
>
> On Sat, Jun 5, 2021 at 2:43 PM ZheNing Hu via GitGitGadget
> <gitgitgadget@gmail.com> wrote:
> >
> > From: ZheNing Hu <adlternative@gmail.com>
> >
> > --- a/builtin/branch.c
> > +++ b/builtin/branch.c
> > @@ -670,6 +674,7 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
> > N_("print only branches of the object"), parse_opt_object_name),
> > OPT_BOOL('i', "ignore-case", &icase, N_("sorting and filtering are case insensitive")),
> > OPT_STRING( 0 , "format", &format.format, N_("format"), N_("format to use for the output")),
> > + OPT_STRING(0, "rest", &format.rest, N_("rest"), N_("specify %(rest) contents")),
> > OPT_END(),
> > };
> >
>
> Although it's not related to this patch. But I just noticed an unusual
> extra space(s) before the first argument of `OPT_STRING()`. (above the
> line you added)
>Yeah, I noticed it too.
Show 16 quoted lines
> > --- a/builtin/for-each-ref.c
> > +++ b/builtin/for-each-ref.c
> > @@ -37,6 +37,7 @@ int cmd_for_each_ref(int argc, const char **argv, const char *prefix)
> >
> > OPT_GROUP(""),
> > OPT_INTEGER( 0 , "count", &maxcount, N_("show only <n> matched refs")),
> > + OPT_STRING( 0 , "rest", &format.rest, N_("rest"), N_("specify %(rest) contents")),
> > OPT_STRING( 0 , "format", &format.format, N_("format"), N_("format to use for the output")),
> > OPT__COLOR(&format.use_color, N_("respect format colors")),
> > OPT_REF_SORT(sorting_tail),
>
> Here too in `OPT_INTEGER()` and `OPT_INTEGER()`.
>
> Also, I don't think these extra space(s) are intended. So you don't
> need to imitate them.
>Maybe... I find it's begin at c3428da8 (Make builtin-for-each-ref.c use parse-opts.) This is something from 2007. So It may be wrong to imitate its format. But this format fix work may be can put in good-first-issue. :)
Show 15 quoted lines
> > --- a/builtin/tag.c
> > +++ b/builtin/tag.c
> > @@ -481,6 +486,7 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
> > OPT_STRING( 0 , "format", &format.format, N_("format"),
> > N_("format to use for the output")),
> > OPT__COLOR(&format.use_color, N_("respect format colors")),
> > + OPT_STRING(0, "rest", &format.rest, N_("rest"), N_("specify %(rest) contents")),
> > OPT_BOOL('i', "ignore-case", &icase, N_("sorting and filtering are case insensitive")),
> > OPT_END()
> > };
>
> Here too in the first line.
>
> Thanks,
> HariomThanks. -- ZheNing Hu