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

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

From
Tamir Duberstein <tamird@gmail.com>
Date
May 11, 2026, 00:07 UTC
Message-ID
<CAJ-ks9mPzCr3obAw5cE071GNjzy_ZLzF4mQdnUbQY5H4WPw3sA@mail.gmail.com>
In-Reply-To
<xmqqik8u95yn.fsf@gitster.g>
On Sun, May 10, 2026 at 7:53 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 19 quoted lines
>
> Tamir Duberstein <tamird@gmail.com> writes:
>
> >  `log.follow`::
> >       If `true`, `git log` will act as if the `--follow` option was used when
> > +     a single pathspec is given.  This has the same limitations as
> > +     `--follow`, i.e. it cannot be used with multiple pathspecs and does not
> > +     work well on non-linear history.  When the pathspec names a directory,
> > +     Git does not follow directory renames, but it still uses the same
> > +     traversal mode as for file rename following; see `--follow` in
> > +     linkgit:git-log[1].  This can be overridden by `--no-follow`.
>
> Saying that the feature does "not work well" on non-lenear history
> is like the behaviour of the feature is "undefined" on such a
> history.  Quite honestly, when you do not give a single filename,
> the behaviour is "undefined", either, so I do not think we want to
> say what happens when the pathspec you give matches a directory.
> The feature only takes a single filename on a linear history.
> Anything else the feature does is "undefined" random behavour.

I observed this "undefined" behavior, which is why I started working on this patch. I think it is not reasonable to deal with undefined behavior by pretending it doesn't exist. The documentation should acknowledge and explain what happens when this option is used for all ways that it can be used.

Previous: Junio C HamanoNext: Junio C Hamano
Message 9 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.