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

Re: git log --follow doesn't follow a rename over a merge

From
James Blackburn <jamesblackburn@gmail.com>
Date
Jun 16, 2011, 21:29 UTC
Message-ID
<BANLkTi=7yFdkNgvGX38JM_GbS7=tqf=1sQ@mail.gmail.com>
In-Reply-To
<7vlix1h8lz.fsf@alter.siamese.dyndns.org>
On 16 June 2011 20:36, Junio C Hamano <gitster@pobox.com> wrote:
Show 11 quoted lines
> James Blackburn <jamesblackburn@gmail.com> writes:
>
>> Given the file was removed during my 'merge' graft in commit X,
>> shouldn't it be visible  in log without --simplify-merges?
>
> The merge simplification logic does not treat earlier parent commits any
> differently than later parent commits of a merge (except when two parents
> are the same with respect to a given pathspec, and if the logic needs to
> pick only one, the earlier parent will be picked), and that is by design.
>
> So the short answer is no.

I think this is quite tough to grok. Git blame shows me a path, and git log -- <path> returns no output in the simple example I gave.

In this case --simplify-merges gives me a complete log for the path,
but man git-log tells me it should do the opposite:
       --simplify-merges
           Additional option to --full-history to remove some needless
merges from the resulting history, as there are
           no selected commits contributing to this merge.

I'm not sure how I would have figured out this switch might be just the trick to show the commits that touched this path, without your input.

As a naive user I expected:
  git log -- four
to tell we which commits changed the path 'four'. Especially those
commits which are reachable from my current HEAD.  I don't really
understand why one branch of history is worth following over another,
especially as the branch chosen, the older one, doesn't contain 'four'
at all.

Cheers, James

Previous: Junio C HamanoNext: James Blackburn
Message 12 of 14 in “git log --follow doesn't follow a rename over a merge”
  1. James BlackburnJun 15, 2011
  2. Jakub NarebskiJun 16, 2011
  3. James BlackburnJun 16, 2011
  4. James BlackburnJun 16, 2011
  5. Jeff KingJun 16, 2011
  6. Jeff KingJun 16, 2011
  7. Junio C HamanoJun 16, 2011
  8. Jeff KingJun 16, 2011
  9. James BlackburnJun 16, 2011
  10. James BlackburnJun 16, 2011
  11. Junio C HamanoJun 16, 2011
  12. James BlackburnJun 16, 2011
  13. James BlackburnJun 16, 2011
  14. James BlackburnJun 16, 2011

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.