Thread (35 messages) 35 messages, 7 authors, 2022-09-11

Re: [PATCH v4] ls-files: introduce "--format" option

From: Phillip Wood <hidden>
Date: 2022-06-28 15:19:31

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 <redacted> 
+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.
+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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help