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

Re: [PATCH] log: let --follow follow renames in merge commits

From
Junio C Hamano <gitster@pobox.com>
Date
May 19, 2026, 08:14 UTC
Message-ID
<xmqqjysz7r41.fsf@gitster.g>
In-Reply-To
<xmqqo6ib7vlp.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> writes:
Show 9 quoted lines
>>> Could you please review this?
>>
>> I'm a bit confused regarding what can be a next step here. I
>> understanding you were away for 3 weeks, so there is a lot to process.
>> :-) Should I just wait more or should I resend this?
>
> Rather, ask other reviewers; when I do not comment on a patch, I
> often am not interested, or too busy and the change does not look
> interesting enough to me to make me drop what I am doing.
Addendum.  As I said in
    https://lore.kernel.org/git/xmqqqzni967o.fsf@gitster.g/

and the subsequent discussion concluded, the "==follow" checkbox feature is meant to work well only in a linear history, and that is inherent to the way it "follows" the single path.

It does not follow different pathname(s) while following a set of different histories merged, e.g., in a history like this (as usual time flows from left to right)

    ----o----A----o
                   \
                    M----o----o----o
                   /
    ----x----B----x

you may start following path F at the HEAD, and after crossing the merge M, one history may find out that path F came from path G. The traveral starts with "F" as the sole element in the pathspec, but once the traversal hits that commit (say, A), the traversal switches to use "G" as the sole element in the pathspec and follows the history down. Even if the other history (i.e., 'x' on the lower history) had path F all along, once the pathspec is swapped to follow "G" on the upper lineage of the history, traversal of the lower lineage that happens after the traversal passes 'A" _will_ try to follow "G" that may not exist at all. Or 'x' may have done the same rename from "G" to "F" at "B". Depending on the order in which "A" and any of these commits on the lower history are visited, the commit that is a child of "B" (which has the path at "F") may be visited after "A", in which case the path in question "F" will not be looked for in it.

A minor "tweak" that does not solve this inherent design issue does not interest me, so...

Previous: Junio C HamanoNext: Miklos Vajna
Message 4 of 18 in “log: let --follow follow renames in merge commits”
  1. log: let --follow follow renames in merge commitsMiklos Vajna, May 12, 2026
  2. Miklos VajnaMay 19, 2026
  3. Junio C HamanoMay 19, 2026
  4. Junio C HamanoMay 19, 2026
  5. log: improve --follow following renames for non-linear historyMiklos Vajna, Jun 8, 2026
  6. Junio C HamanoJun 8, 2026
  7. log: improve --follow following renames for non-linear historyMiklos Vajna, Jun 11, 2026
  8. Junio C HamanoJun 11, 2026
  9. log: improve --follow following renames for non-linear historyMiklos Vajna, Jun 15, 2026
  10. log: improve --follow following renames for non-linear historyMiklos Vajna, Jun 22, 2026
  11. Junio C HamanoJun 22, 2026
  12. Miklos VajnaJun 23, 2026
  13. Junio C HamanoJun 12, 2026
  14. Miklos VajnaMay 20, 2026
  15. Jeff KingMay 22, 2026
  16. log: improve --follow following renames in merge commitsMiklos Vajna, May 23, 2026
  17. Miklos VajnaMay 30, 2026
  18. Miklos VajnaJun 4, 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.