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

Re: [PATCH v4] doc: clarify --follow and log.follow for git log

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 25, 2026, 17:23 UTC
Message-ID
<xmqqpl1efs9j.fsf@gitster.g>
In-Reply-To
<20260625-document-log-no-follow-v4-1-9bb233248b8f@gmail.com>
Tamir Duberstein <tamird@gmail.com> writes:
Show 12 quoted lines
> 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
OK.
> Changes in v3:
> - List `--no-follow` before `--follow`.

Ah, I think I misread the patch and its preimage while reviewing v2 and I didn't notice my mistake when you sent v3. Sorry.

I somehow thought that the original before the patch was
    --follow::
	... description of follow here ...
    --no-follow::
	... description of no-follow here ..
and I thought the patch was doing
    --follow::
    --no-follow::
	... combined description ...

and commented that it was a good change. I didn't mean to comment which between --no-foo and --foo should come first (looking at the output of "git grep -C1 -E -e '^`?--no-'", I think --foo should come before --no-foo, especially when --foo does not take any value, but it seems there are many instances that list the negated form first).

As the existing text has mixture of --foo before and after --no-foo let's not worry about which one should come first, but if we have a chance to redo this patch, I would actually prefer to see --follow comes before --no-follow.

Show 10 quoted lines
> 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`.

OK. This is the usual "command line options override configured default" in play.

Show 15 quoted lines
> 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.

Ditto, but I am not sure if we want to sprinkle the "command line overrides configured defaults" all over the place. The description of --[no-]decorate below says

	default to configuration value of `log.decorate` if
	configured, otherwise `auto`.

which silently assumes that the readers _know_ that command line --no-decorate overrides that default. And I think it is a sensible assumption to make.

So, while the patch may have meant well, I think this part should actually become a single liner that adds `--no-follow`:: and nothing else. The changes to config/log.adoc should probably be kept.

Thanks.
Previous: Tamir DubersteinNext: Tamir Duberstein
Message 16 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.