From cf3f547bb96757b32dcfba14ddf64c79b54c75b7 Mon Sep 17 00:00:00 2001 From: Toon Claes Date: Fri, 16 Jan 2026 14:22:51 +0100 Subject: [PATCH] last-modified: document option --max-depth 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 Signed-off-by: Junio C Hamano --- Documentation/git-last-modified.adoc | 8 +++++++- builtin/last-modified.c | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Documentation/git-last-modified.adoc b/Documentation/git-last-modified.adoc index 2e5f370c15..a3992db3f2 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] [-z] +git last-modified [--recursive] [--show-trees] [--max-depth=] [-z] [] [[--] ...] DESCRIPTION @@ -33,6 +33,12 @@ OPTIONS Show tree entries even when recursing into them. It has no effect without `--recursive`. +`--max-depth=`:: + For each pathspec given on the command line, descend at most `` + 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. diff --git a/builtin/last-modified.c b/builtin/last-modified.c index bc51d16b92..630687b81f 100644 --- a/builtin/last-modified.c +++ b/builtin/last-modified.c @@ -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=] [-z]\n" " [] [[--] ...]"), NULL }; -- 2.47.3