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, 18:21 UTC
Message-ID
<BANLkTimmKnzD7LTApxzw5oTpvLU7oM0yjw@mail.gmail.com>
In-Reply-To
<20110616173451.GB6584@sigill.intra.peff.net>
> Doesn't:
>  git log -- plugins/org.eclipse.dd.dsf.debug/src/org/eclipse/dd/dsf/debug/service/IBreakpoints.java
> do that?
Unfortunately that returuns no output.

If I add --follow, I get history: git log --follow --oneline -- plugins/org.eclipse.dd.dsf.debug/src/org/eclipse/dd/dsf/debug/service/IBreakpoints.java 10580b5 Updated copyright statements. ...

Where 10580 is a distant parent of c1e6da which was merged in to 5b47187.
On 16 June 2011 18:45, Jeff King <peff@peff.net> wrote:
Show 6 quoted lines
> Usually you would graft the tip of the old history to the root commit of
> the new history. So it's not a merge, but makes it look like a
> contiguous linear history near the graft. But that's only a
> per-repository thing. If you want to join two histories in the actual
> history graph, you would merge them; if one supersedes the other, then
> you would use the "ours" merge strategy to ignore the other side.
In this case the commit is a 'merge' commit as history looks like:
  2002 ---o----o-----o-----o-----X-----o-----o-----o--- 2011         (CDT)
                                     /
  2006 ---o----o-----o-----o--   (2009)                                  (DSF)

CDT has existed since 2002. In 2006, at X, DSF was committed onto HEAD of CDT. Basically wholesale apart from the path (Java package) change (+some minor changes to 'import's).

So I created a graft from the commit which made it appear from CDT onto the HEAD of a DSF as it was when the import happened. Which makes X have two parents.

Cheers, James

Previous: James Blackburn
Message 14 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.