aboutsummaryrefslogtreecommitdiff
path: root/Documentation
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2026-02-05 15:42:01 -0800
committerJunio C Hamano <gitster@pobox.com>2026-02-05 15:42:01 -0800
commit7758f84682eb248b8738ea5d9b72e60864fa2ee0 (patch)
tree525c27c12c1901987a6886754a3a9a5fc4d89a41 /Documentation
parent1f17604ce4e35e8a94e73c5c11e5882812663c2f (diff)
parent9dcc09bed13aba0dc93d253f18ee2c7da5970c0c (diff)
downloadgit-7758f84682eb248b8738ea5d9b72e60864fa2ee0.tar.xz
Merge branch 'tc/last-modified-options-cleanup'
The "-z" and "--max-depth" documentation (and implementation of "-z") in the "git last-modified" command have been updated. * tc/last-modified-options-cleanup: last-modified: change default max-depth to 0 last-modified: document option '--max-depth' last-modified: document option '-z' last-modified: clarify in the docs the command takes a pathspec
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/git-last-modified.adoc45
1 files changed, 36 insertions, 9 deletions
diff --git a/Documentation/git-last-modified.adoc b/Documentation/git-last-modified.adoc
index 602843e095..d7d16fc4f7 100644
--- a/Documentation/git-last-modified.adoc
+++ b/Documentation/git-last-modified.adoc
@@ -9,7 +9,8 @@ git-last-modified - EXPERIMENTAL: Show when files were last modified
SYNOPSIS
--------
[synopsis]
-git last-modified [--recursive] [--show-trees] [<revision-range>] [[--] <path>...]
+git last-modified [--recursive] [--show-trees] [--max-depth=<depth>] [-z]
+ [<revision-range>] [[--] <pathspec>...]
DESCRIPTION
-----------
@@ -24,13 +25,23 @@ OPTIONS
`-r`::
`--recursive`::
- Instead of showing tree entries, step into subtrees and show all entries
- inside them recursively.
+ Recursively traverse into all subtrees. By default, the command only
+ shows tree entries matching the `<pathspec>`. With this option, it
+ descends into subtrees and displays all entries within them.
+ Equivalent to `--max-depth=-1`.
`-t`::
`--show-trees`::
- Show tree entries even when recursing into them. It has no effect
- without `--recursive`.
+ Show tree entries even when recursing into them.
+
+`--max-depth=<depth>`::
+ For each pathspec given on the command line, traverse at most `<depth>`
+ levels into subtrees. A negative value means no limit.
+ The default is 0, which shows all paths matching the pathspec
+ without descending into subtrees.
+
+`-z`::
+ Terminate each line with a _NUL_ character rather than a newline.
`<revision-range>`::
Only traverse commits in the specified revision range. When no
@@ -39,10 +50,26 @@ OPTIONS
spell `<revision-range>`, see the 'Specifying Ranges' section of
linkgit:gitrevisions[7].
-`[--] <path>...`::
- For each _<path>_ given, the commit which last modified it is returned.
- Without an optional path parameter, all files and subdirectories
- in path traversal the are included in the output.
+`[--] <pathspec>...`::
+ Show the commit that last modified each path matching _<pathspec>_.
+ 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
--------