Re: [PATCH v9] ls-files: introduce "--format" option
- From
ZheNing Hu <adlternative@gmail.com>
- Date
- Sep 11, 2022, 11:01 UTC
- Message-ID
- <CAOLTT8RFWJ=LdZr1s5DWE7C2Uu9juzzfuhbXvQPe=b+ppXsPsw@mail.gmail.com>
- In-Reply-To
- <CANYiYbFGSfg+iFV1ovhCSxW0YQSpemKUN-sS+F0BHee7KD5arA@mail.gmail.com>
Jiang Xin <worldhello.net@gmail.com> 于2022年9月8日周四 10:01写道:
Show 43 quoted lines
>
> On Sat, Jul 23, 2022 at 2:54 PM ZheNing Hu via GitGitGadget
> <gitgitgadget@gmail.com> wrote:
>
> > diff --git a/builtin/ls-files.c b/builtin/ls-files.c
> > index e791b65e7e9..779dc18e59d 100644
> > --- a/builtin/ls-files.c
> > +++ b/builtin/ls-files.c
> > @@ -222,6 +234,73 @@ static void show_submodule(struct repository *superproject,
> > repo_clear(&subrepo);
> > }
> >
> > +struct show_index_data {
> > + const char *pathname;
> > + struct index_state *istate;
> > + const struct cache_entry *ce;
> > +};
> > +
> > +static size_t expand_show_index(struct strbuf *sb, const char *start,
> > + void *context)
> > +{
> > + struct show_index_data *data = context;
> > + const char *end;
> > + const char *p;
> > + size_t len = strbuf_expand_literal_cb(sb, start, NULL);
> > + struct stat st;
> > +
> > + if (len)
> > + return len;
> > + if (*start != '(')
> > + die(_("bad ls-files format: element '%s' "
>
> Good, the last space acts as a separator between two lines.
>
> > + "does not start with '('"), start);
> > +
> > + end = strchr(start + 1, ')');
> > + if (!end)
> > + die(_("bad ls-files format: element '%s'"
>
> Missing the last space to seperate two lines, and this leads to wrong
> l10n message. See:
>Thank you for pointing out the error, I will fix it quickly.
> https://github.com/git-l10n/pot-changes/blob/pot/main/2022-08-03.diff#L70 > > -- > Jiang Xin
Thanks, ZheNing Hu