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

Re: git log --follow after subtree merge

From
Jeff King <peff@peff.net>
Date
May 11, 2017, 06:35 UTC
Message-ID
<20170511063549.fniwyggsj7wffgf5@sigill.intra.peff.net>
In-Reply-To
<CAJZjrdX-oAP7GFcPJ_FVNCMuErF7DNkq97KhjwgBX_G5tGXoFg@mail.gmail.com>
On Wed, May 10, 2017 at 02:15:23PM -0500, Samuel Lijin wrote:
Show 12 quoted lines
> On Wed, May 10, 2017 at 9:46 AM, Jonny Gilchrist
> <jonnygilchrist@gmail.com> wrote:
> > Hi,
> >
> > After doing a subtree merge, using 'git log' and 'git log --follow' on
> > files in the subtree show only the merge commit in which they were
> > added.
> >
> > After reading around I understand that the issue is that git log
> > --follow doesn't track renames that occur during a merge.
> 
> Try git log --follow -M. (You may also want to combine this with -l and/or -C).

You shouldn't need to specify "-M" with --follow, as the diff done by try_to_follow_renames() turns on rename (and copy) detection explicitly. I suspect the problem is that git-log does not do merge diffs at all by default, and you'd need "-c" or "--cc" (or maybe even "-m") to turn them on.

I wouldn't be surprised if there are other problems where that code path isn't quite ready to handle merge commits, though.

-Peff
Previous: Samuel LijinNext: Jeff King
Message 3 of 5 in “git log --follow after subtree merge”
  1. Jonny GilchristMay 10, 2017
  2. Samuel LijinMay 10, 2017
  3. Jeff KingMay 11, 2017
  4. Jeff KingMay 11, 2017
  5. Konstantin KhomoutovMay 11, 2017

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.