Re: [PATCH v4] ls-files: introduce "--format" option
- From
- Phillip Wood <phillip.wood123@gmail.com>
- Date
- Jun 28, 2022, 15:19 UTC
- Message-ID
- <a556feaa-5f72-7c83-7156-fe91f18fc24a@gmail.com>
- In-Reply-To
- <pull.1262.v4.git.1656257376109.gitgitgadget@gmail.com>
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:
Show 21 quoted lines
> 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.
Show 5 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?
Best Wishes
Phillip