]> git.ipfire.org Git - thirdparty/git.git/commitdiff
last-modified: document option --max-depth
authorToon Claes <toon@iotcl.com>
Fri, 16 Jan 2026 13:22:51 +0000 (14:22 +0100)
committerJunio C Hamano <gitster@pobox.com>
Fri, 16 Jan 2026 18:27:20 +0000 (10:27 -0800)
Option --max-depth is supported by git-last-modified(1), because it was
added to the diff machinery in a1dfa5448d (diff: teach tree-diff a
max-depth parameter, 2025-08-07).

This option is useful for everyday use of the git-last-modified(1)
command, so document it's existence in the man page.

Signed-off-by: Toon Claes <toon@iotcl.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-last-modified.adoc
builtin/last-modified.c

index 2e5f370c15746fa0f10733ad65388588f110906e..a3992db3f2a2e491c5abe26dff20bda1e79a02b7 100644 (file)
@@ -9,7 +9,7 @@ git-last-modified - EXPERIMENTAL: Show when files were last modified
 SYNOPSIS
 --------
 [synopsis]
-git last-modified [--recursive] [--show-trees] [-z]
+git last-modified [--recursive] [--show-trees] [--max-depth=<depth>] [-z]
                  [<revision-range>] [[--] <path>...]
 
 DESCRIPTION
@@ -33,6 +33,12 @@ OPTIONS
        Show tree entries even when recursing into them. It has no effect
        without `--recursive`.
 
+`--max-depth=<depth>`::
+       For each pathspec given on the command line, descend at most `<depth>`
+       levels of directories. A negative value means no limit.
+       Setting a positive value implies `--recursive`.
+       Cannot be combined with wildcards in the pathspec.
+
 `-z`::
        Terminate each line with a _NUL_ character rather than a newline.
 
index bc51d16b92f6f22cf33aebee75cfcde58065803f..630687b81f68a447749b41b525021ff9ed5d2cc5 100644 (file)
@@ -511,7 +511,7 @@ int cmd_last_modified(int argc, const char **argv, const char *prefix,
        struct last_modified lm = { 0 };
 
        const char * const last_modified_usage[] = {
-               N_("git last-modified [--recursive] [--show-trees] [-z]\n"
+               N_("git last-modified [--recursive] [--show-trees] [--max-depth=<depth>] [-z]\n"
                   "                  [<revision-range>] [[--] <path>...]"),
                NULL
        };