git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v5] doc: clarify --follow's single-file limitation

From
MKMarat Khalili <qm2k21@gmail.com>
Date
Sep 28, 2026, 17:16 UTC
Message-ID
<a745126c-7e40-47e9-afa4-7ebea0640bf6@gmail.com>
In-Reply-To
<20260926-document-log-no-follow-v5-1-d04efeca7551@gmail.com>
On 26/09/2026 12:56, Tamir Duberstein wrote:
Show 8 quoted lines
> 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.
nit: "document --no-follow disabling the mode"?
>
> Assisted-by: LLM
> Signed-off-by: Tamir Duberstein <tamird@gmail.com>

LGTM FWIW (looking at this part of the code right now considering possible improvements). Handing of --follow has a few more other limitations that can be documented, but fixing them is probably more interesting. Disclaimer: I just joined and did not follow this thread from the beginning.

Acked-by: Marat Khalili <qm2k21@gmail.com>
// snip
Show 51 quoted lines
> ---
>   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
Previous: Tamir Duberstein
Message 18 of 18 in “doc: git-log: document --no-follow”
  1. doc: git-log: document --no-followTamir Duberstein, May 7, 2026
  2. doc: git-log: clarify --follow optionsTamir Duberstein, May 7, 2026
  3. Junio C HamanoMay 10, 2026
  4. Tamir DubersteinMay 10, 2026
  5. Junio C HamanoMay 10, 2026
  6. Tamir DubersteinMay 10, 2026
  7. doc: clarify --follow and log.follow for git logTamir Duberstein, May 10, 2026
  8. Junio C HamanoMay 10, 2026
  9. Tamir DubersteinMay 11, 2026
  10. Junio C HamanoMay 11, 2026
  11. Tamir DubersteinMay 11, 2026
  12. Junio C HamanoMay 11, 2026
  13. Tamir DubersteinMay 11, 2026
  14. Junio C HamanoMay 11, 2026
  15. doc: clarify --follow and log.follow for git logTamir Duberstein, Jun 25, 2026
  16. Junio C HamanoJun 25, 2026
  17. doc: clarify --follow's single-file limitationTamir Duberstein, Sep 26, 2026
  18. Marat KhaliliSep 28, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.