From: Tamir Duberstein <tamird@gmail.com>
To: git@vger.kernel.org
Cc: "Jean-Noël Avila" <jn.avila@free.fr>,
"Junio C Hamano" <gitster@pobox.com>,
"Miklos Vajna" <vmiklos@collabora.com>,
"Tamir Duberstein" <tamird@gmail.com>
Subject: [PATCH v5] doc: clarify --follow's single-file limitation
Date: Sat, 26 Sep 2026 07:56:21 -0400 [thread overview]
Message-ID: <20260926-document-log-no-follow-v5-1-d04efeca7551@gmail.com> (raw)
In-Reply-To: <20260625-document-log-no-follow-v4-1-9bb233248b8f@gmail.com>
Saying that --follow works only for a single file leaves open whether
other inputs are rejected or ignored. In particular, log.follow enables
following for a directory argument, although that use is unsupported.
Distinguish errors for an explicit --follow with no paths or multiple
paths from the configured default, which has no effect in those cases.
State that results for directory arguments and accepted wildcard
patterns are unspecified, and document --no-follow to disable the mode.
Assisted-by: LLM
Signed-off-by: Tamir Duberstein <tamird@gmail.com>
---
Changes in v5:
- Distinguish explicit --follow errors from cases where log.follow
leaves the command unchanged.
- State that results for directory arguments and accepted wildcard
patterns are unspecified, and explain how to disable following.
- List --follow before --no-follow.
- Rebase onto current master, which includes mv/log-follow-mergy.
- Link to v4: https://patch.msgid.link/20260625-document-log-no-follow-v4-1-9bb233248b8f@gmail.com
Changes in v4:
- Limit the patch to `--no-follow` and its `log.follow` override; leave
the existing `--follow` limitations unchanged.
- Link to v3: https://patch.msgid.link/20260510-document-log-no-follow-v3-1-d6d3368c64bb@gmail.com
Changes in v3:
- Retitle the patch to avoid the awkward `doc: git-log:` subject.
- List `--no-follow` before `--follow`.
- Clarify that `--follow` follows a single file across renames, even
though the option is accepted with exactly one pathspec.
- Document the directory-pathspec case: directory renames are not
followed, but `--follow` still uses file-follow traversal, disabling
normal pathspec pruning and possibly changing which commits,
especially merges, are shown.
- Link to v2: https://patch.msgid.link/20260507-document-log-no-follow-v2-1-ee7bcbbe612f@gmail.com
Changes in v2:
- Document --follow as limited to a single pathspec, not a single file.
- Adjust the log.follow documentation to use the same wording.
- Link to v1: https://patch.msgid.link/20260507-document-log-no-follow-v1-1-46ce02490eba@gmail.com
---
Range-diff versus v4:
1: ee9e9a1817 < -: ---------- doc: clarify --follow and log.follow for git log
-: ---------- > 1: 993a2ed91c doc: clarify --follow's single-file limitation
---
Documentation/config/log.adoc | 10 +++++++---
Documentation/git-log.adoc | 10 ++++++++--
2 files changed, 15 insertions(+), 5 deletions(-)
diff --git a/Documentation/config/log.adoc b/Documentation/config/log.adoc
index f7dfce69b5..4efdd4f61b 100644
--- a/Documentation/config/log.adoc
+++ b/Documentation/config/log.adoc
@@ -51,9 +51,13 @@ This is the same as the `--decorate` option of the `git log`.
details. Defaults to `separate`.
`log.follow`::
- If `true`, `git log` will act as if the `--follow` option was used when
- a single <path> is given. This has the same limitations as `--follow`,
- i.e. it cannot be used to follow multiple files.
+ If `true`, `git log` enables `--follow` when a single <path> is
+ given. With no paths, multiple paths, or pathspec magic unsupported
+ by `--follow`, this setting has no effect.
++
+A single directory argument or an accepted wildcard pattern still
+enables `--follow`, with unspecified results. Use `--no-follow` to
+override this setting.
`log.graphColors`::
A list of colors, separated by commas, that can be used to draw
diff --git a/Documentation/git-log.adoc b/Documentation/git-log.adoc
index fb3ac11283..a40b3d1c05 100644
--- a/Documentation/git-log.adoc
+++ b/Documentation/git-log.adoc
@@ -28,8 +28,14 @@ OPTIONS
-------
`--follow`::
- Continue listing the history of a file beyond renames
- (works only for a single file).
+`--no-follow`::
+ Continue listing the history of a single file beyond renames.
+ An explicit `--follow` requires exactly one path argument; Git
+ reports an error if none or more than one is given.
++
+A directory argument is accepted and enables `--follow`, but results
+for directories and accepted wildcard patterns are unspecified.
+Use `--no-follow` for directory history or wildcard matching.
`--no-decorate`::
`--decorate[=(short|full|auto|no)]`::
---
base-commit: 0f8e75abebff0877cae681a3d5ff31ac47f54220
change-id: 20260507-document-log-no-follow-72c33dc15017
next prev parent reply other threads:[~2026-09-26 11:56 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-07 14:14 [PATCH] doc: git-log: document --no-follow Tamir Duberstein
2026-05-07 18:13 ` [PATCH v2] doc: git-log: clarify --follow options Tamir Duberstein
2026-05-10 21:31 ` Junio C Hamano
2026-05-10 22:30 ` Tamir Duberstein
2026-05-10 23:48 ` Junio C Hamano
2026-05-10 23:51 ` Tamir Duberstein
2026-05-10 22:31 ` [PATCH v3] doc: clarify --follow and log.follow for git log Tamir Duberstein
2026-05-10 23:53 ` Junio C Hamano
2026-05-11 0:07 ` Tamir Duberstein
2026-05-11 0:13 ` Junio C Hamano
2026-05-11 0:32 ` Tamir Duberstein
2026-05-11 0:46 ` Junio C Hamano
2026-05-11 1:28 ` Tamir Duberstein
2026-05-11 2:06 ` Junio C Hamano
2026-06-25 16:01 ` [PATCH v4] " Tamir Duberstein
2026-06-25 17:23 ` Junio C Hamano
2026-09-26 11:56 ` Tamir Duberstein [this message]
2026-09-28 17:16 ` [PATCH v5] doc: clarify --follow's single-file limitation Marat Khalili
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260926-document-log-no-follow-v5-1-d04efeca7551@gmail.com \
--to=tamird@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jn.avila@free.fr \
--cc=vmiklos@collabora.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox