[PATCH v4] doc: clarify --follow and log.follow for git log
- From
Tamir Duberstein <tamird@gmail.com>
- Date
- Jun 25, 2026, 16:01 UTC
- Message-ID
- <20260625-document-log-no-follow-v4-1-9bb233248b8f@gmail.com>
- In-Reply-To
- <20260510-document-log-no-follow-v3-1-d6d3368c64bb@gmail.com>
aebbcf5797 (diff: accept --no-follow option, 2012-09-21) added the --no-follow option, but git-log(1) only documents --follow.
Document --no-follow alongside --follow, and note that it overrides the log.follow configuration.
Signed-off-by: Tamir Duberstein <tamird@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
This conflicts textually with `mv/log-follow-mergy` in `next`. Keep that topic's shorter limitation text and append the `--no-follow` override.
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 --- Documentation/config/log.adoc | 2 +- Documentation/git-log.adoc | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/Documentation/config/log.adoc b/Documentation/config/log.adoc index f20cc25cd7..58147dff9b 100644 --- a/Documentation/config/log.adoc +++ b/Documentation/config/log.adoc @@ -54,7 +54,7 @@ This is the same as the `--decorate` option of the `git log`. 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 and does not work well - on non-linear history. + on non-linear history. This can be overridden by `--no-follow`. `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..64fbec0f57 100644 --- a/Documentation/git-log.adoc +++ b/Documentation/git-log.adoc @@ -27,9 +27,12 @@ each commit introduces are shown. OPTIONS ------- +`--no-follow`:: `--follow`:: Continue listing the history of a file beyond renames - (works only for a single file). + (works only for a single file). `--no-follow` disables this + behavior, including when it was enabled by the + `log.follow` configuration variable. `--no-decorate`:: `--decorate[=(short|full|auto|no)]`:: --- base-commit: ab776a62a78576513ee121424adb19597fbb7613 change-id: 20260507-document-log-no-follow-72c33dc15017 Best regards, -- Tamir Duberstein <tamird@gmail.com>