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, 22:14 UTC
Message-ID
<BANLkTi=S6B6n717CkcGcrek9r4RQ4wzwtA@mail.gmail.com>
In-Reply-To
<BANLkTikMNYyV40XM26rc6Ov6ZYO643mukA@mail.gmail.com>
On 16 June 2011 19:41, James Blackburn <jamesblackburn@gmail.com> wrote:
> I think 2f1c904 is entirely wrong too -- it's another graft I've done,
> to a different repo, which isn't to do with DSF, and doesn't contain
> IBreakpoints.java:
This looks like a bug?   man git-log:
       [--] <path>...
           Show only commits that affect any of the specified paths.
To prevent confusion with options and branch names,
           paths may need to be prefixed with "-- " to separate them
from options or refnames.
git log --graph --oneline
* 6530823 six2
*   05512d0 nine
|\
| * 9917e1c seven
| * 76a230e six
| * a6d7961 six
* f7f43f9 four2
*   94392ac eight
|\
| * 5cf0b04 five
| * 5183657 four
* bd329af three
* 57aafee two
* 3d9ecdf one

git log --simplify-merges --oneline -- four 05512d0 nine 94392ac eight 5183657 four

but the merge commit at 'nine' has nothing to do with that path 'four'.
Reproduction steps:
commit() {
 echo $1 >>$1 && git add $1 && git commit -m $1
}

git init repo cd repo commit one commit two commit three

git symbolic-ref HEAD refs/heads/newroot rm * git rm --cached * commit four commit five

git symbolic-ref HEAD refs/heads/newnewroot rm * git rm --cached * commit six commit six commit seven

git checkout master git merge --no-commit newroot

git mv four four2 commit eight commit four2

git merge --no-commit newnewroot

git mv six six2 commit nine commit six2

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