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
Jeff King <peff@peff.net>
Date
Jun 16, 2011, 18:15 UTC
Message-ID
<20110616181509.GA12689@sigill.intra.peff.net>
In-Reply-To
<7vy611hd38.fsf@alter.siamese.dyndns.org>
On Thu, Jun 16, 2011 at 10:59:23AM -0700, Junio C Hamano wrote:
Show 16 quoted lines
> > Doesn't:
> >
> >   git log -- plugins/org.eclipse.dd.dsf.debug/src/org/eclipse/dd/dsf/debug/service/IBreakpoints.java
> >
> > do that?
> 
> If the file emerged in one branch (either the primary or a side branch) in
> the past as a failed experiment and then got removed before merging back,
> i.e.
> 
>    past ---o----o-----o-----o-----o-----o-----o-----o--- now
>             \                          /
>              o----*----o----o----*----o
>                   ^added         ^removed
> 
> then the merges are simplified away and you would not see it.

Ah, right. The default simplification so often does what I want that I forget there are cases it can miss.

> Perhaps simplify-merges option may help.
This test case shows full-history helping:
-- >8 --
commit() {
  echo $1 >$1 && git add $1 && git commit -m $1
}

git init repo && cd repo && commit one && commit two && commit three && git checkout -b side HEAD^ && commit four && commit five && git rm five && git commit -m "remove five" && commit six && git checkout master && git merge side && echo "==> default log (shows nothing)" && git --no-pager log -- five echo "==> full-history" && git --no-pager log --full-history -- five

Previous: Junio C HamanoNext: James Blackburn
Message 8 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.