Re: [PATCH v4] ls-files: introduce "--format" option
- From
ZheNing Hu <adlternative@gmail.com>
- Date
- Jul 1, 2022, 12:47 UTC
- Message-ID
- <CAOLTT8QgsdkCrfYY9Of7qgDkvvZc+=Bao4irX6xq_C5wr4vb6Q@mail.gmail.com>
- In-Reply-To
- <a556feaa-5f72-7c83-7156-fe91f18fc24a@gmail.com>
Phillip Wood <phillip.wood123@gmail.com> 于2022年6月28日周二 23:19写道:
Show 32 quoted lines
> > Hi ZheNing > > This looks good, I don't have much to add beyond the comments others > have left. > > On 26/06/2022 16:29, ZheNing Hu via GitGitGadget wrote: > > From: ZheNing Hu <adlternative@gmail.com> > > +FIELD NAMES > > +----------- > > +Various values from structured fields can be used to interpolate > > +into the resulting output. For each outputting line, the following > > +names can be used: > > + > > +objectmode:: > > + The mode of the file which is recorded in the index. > > +objectname:: > > + The name of the file which is recorded in the index. > > +stage:: > > + The stage of the file which is recorded in the index. > > +eolinfo:index:: > > + The <eolinfo> of the file which is recorded in the index. > > +eolinfo:worktree:: > > + The <eolinfo> of the file which is recorded in the working tree. > > +eolattr:: > > + The <eolattr> of the file which is recorded in the index. > > +path:: > > + The pathname of the file which is recorded in the index. > > I think starting with this shorter list of field names is a good idea, > we can always add more fields later if there is a demand for %(flags) etc. >
Agree.
Show 8 quoted lines
> > +test_expect_success 'git ls-files --format with --debug' ' > > + git ls-files --debug >expect && > > + git ls-files --format="%(path)" --debug >actual && > > + test_cmp expect actual > > +' > > What's the motivation for being able to combine --format with --debug? >
I guess it may help us get debug informations together with --format output when we are doing some tests.
> Best Wishes > > Phillip
ZheNing Hu