Re: [PATCH v3 4/4] last-modified: change default max-depth to 0
- From
- Kristoffer Haugsbakk <kristofferhaugsbakk@fastmail.com>
- Date
- Jan 25, 2026, 11:24 UTC
- Message-ID
- <0b97e8fd-1dfc-4a38-9c77-22467f38fd3b@app.fastmail.com>
- In-Reply-To
- <20260120-toon-last-modified-zzzz-v3-4-9bffd4968b0e@iotcl.com>
On Tue, Jan 20, 2026, at 22:47, Toon Claes wrote:
Show 24 quoted lines
> By default git-last-modified(1) doesn't recurse into subtrees. So when > the pathspec contained a path in a subtree, the command would only print > the commit information about the parent tree of the path, like: > > $ git last-modified -- path/file > aaa0aab1bbb2bcc3ccc4ddd5dde6eee7eff8fff9 path > > Change the default behavior to give commit information about the exact > path instead: > > $ git last-modified -- path/file > aaa0aab1bbb2bcc3ccc4ddd5dde6eee7eff8fff9 path/file > > To achieve this, the default max-depth is changed to 0 and recursive is > always enabled. > > The handling of option '-r' is modified to disable a max-depth, > resulting in the behavior of this option to remain unchanged. > > No existing tests were modified, because there didn't exist any tests > covering the example above. But more tests are added to cover this now. > > Signed-off-by: Toon Claes <toon@iotcl.com> > ---
Thanks. I think this makes more sense.
Show 11 quoted lines
>[snip] > --- a/Documentation/git-last-modified.adoc > +++ b/Documentation/git-last-modified.adoc > @@ -25,13 +25,14 @@ 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
This should be s/`<pathspec>`/_<pathspec>_ since this is a `[synopsis]` doc. But this is in `next` so it will have to be left for another time.
>[snip]