aboutsummaryrefslogtreecommitdiff
path: root/Documentation
diff options
context:
space:
mode:
authorToon Claes <toon@iotcl.com>2026-01-20 22:47:09 +0100
committerJunio C Hamano <gitster@pobox.com>2026-01-20 14:13:04 -0800
commit209574de2d2ab0a264522c8c44c3eebb6d03ec43 (patch)
tree56c0fdbe4e22735e8e13a582bba89f31acfa5abc /Documentation
parentb143f0f60816bbb2095eadc15d81b49c131f6a19 (diff)
downloadgit-209574de2d2ab0a264522c8c44c3eebb6d03ec43.tar.xz
last-modified: document option '-z'
The command git-last-modified(1) already recognizes the option '-z', and similar to many other commands this will make the output NUL-terminated instead of using newlines. Although, this option is missing from the documentation, so add it. In addition to that, to have '-z' also appear in the help output of `git last-modified -h`, move the handling of '-z' to parse_options() in builtin/last-modified.c itself. Before, the parsing of option '-z' was done by diff_opt_parse(), which is called by setup_revisions(). That would fill in `struct diff_options::line_termination`, but that field was not used by the diff machinery itself. Thus it makes more sense to have the handling of that option completely in builtin/last-modified.c. Signed-off-by: Toon Claes <toon@iotcl.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/git-last-modified.adoc21
1 files changed, 20 insertions, 1 deletions
diff --git a/Documentation/git-last-modified.adoc b/Documentation/git-last-modified.adoc
index 7c3fd844b8..3760fd33a1 100644
--- a/Documentation/git-last-modified.adoc
+++ b/Documentation/git-last-modified.adoc
@@ -9,7 +9,7 @@ git-last-modified - EXPERIMENTAL: Show when files were last modified
SYNOPSIS
--------
[synopsis]
-git last-modified [--recursive] [--show-trees]
+git last-modified [--recursive] [--show-trees] [-z]
[<revision-range>] [[--] <pathspec>...]
DESCRIPTION
@@ -33,6 +33,9 @@ OPTIONS
Show tree entries even when recursing into them. It has no effect
without `--recursive`.
+`-z`::
+ Terminate each line with a _NUL_ character rather than a newline.
+
`<revision-range>`::
Only traverse commits in the specified revision range. When no
`<revision-range>` is specified, it defaults to `HEAD` (i.e. the whole
@@ -45,6 +48,22 @@ OPTIONS
If no _<pathspec>_ is given, all files and subdirectories are included.
See linkgit:gitglossary[7] for details on pathspec syntax.
+OUTPUT
+------
+
+The output is in the format:
+
+------------
+ <oid> TAB <path> LF
+------------
+
+If a path contains any special characters, the path is C-style quoted. To
+avoid quoting, pass option `-z` to terminate each line with a NUL.
+
+------------
+ <oid> TAB <path> NUL
+------------
+
SEE ALSO
--------
linkgit:git-blame[1],