From: James Blackburn <jamesblackburn@gmail.com>
To: git@vger.kernel.org
Subject: git log --follow doesn't follow a rename over a merge
Date: Wed, 15 Jun 2011 23:41:50 +0100 [thread overview]
Message-ID: <BANLkTimjEp0ntq80qttT9uZN2YGuhsnZBw@mail.gmail.com> (raw)
Hi All,
I'm trying, without success, to get git log to show the history of a
file across a rename. I'm using git version 1.7.5.4, and git blame
has no such issues tracking the source of the lines.
This is part of a CVS migration. In the repo a number of directories
were committed atomically, but they originated from another CVS
repository. During the migration, I've grafted the history from the
originating repository onto the destination repo's commit of the
content. Blame looks good, but log won't find the rename.
Git blame attributes 3 files:
> git blame dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/IBreakpoints.java | awk '{print $2}' |sort |uniq
dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/IBreakpoints.java
plugins/org.eclipse.dd.dsf/src/org/eclipse/dd/dsf/debug/IBreakpoints.java
plugins/org.eclipse.dd.dsf.debug/src/org/eclipse/dd/dsf/debug/service/IBreakpoints.java
Git log shows:
> git log --oneline dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/IBreakpoints.java
70237c3 Bug 315439 Fix up copyright
6a53ab4 [290074] - [services][breakpoints] IBreakpointDMData interface
should extend IDMData
640102e partial fix for Bugzilla 265882
5b47187 Migrated DSF and DSF-GDB to the CDT project.
And it shows one fewer if I turn on --follow (with as many
combinations of -M -C as I've tried):
> git log -M -C -C --follow --oneline dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/IBreakpoints.java
70237c3 Bug 315439 Fix up copyright
6a53ab4 [290074] - [services][breakpoints] IBreakpointDMData interface
should extend IDMData
640102e partial fix for Bugzilla 265882
My new merge commit is 5b47187 (when the content first arrived in the repo):
> git show 5b47187
commit 5b471873662a87a77cfd854c98fca9c9948aa878
Merge: 4709306 c1e6da2
...
I can see the file in the parent of the merge:
> git show c1e6da2:plugins/org.eclipse.dd.dsf.debug/src/org/eclipse/dd/dsf/debug/service/IBreakpoints.java
...
and the renamed file after the merge:
> git show 5b47187:dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/IBreakpoints.java
...
(Neither file exists on the 4709 side)
Interestingly the tricks mentioned here
(http://stackoverflow.com/questions/953481/restore-a-deleted-file-in-a-git-repo)
for working out where a file was removed, produce no output:
> git log --follow --diff-filter=D --oneline -- plugins/org.eclipse.dd.dsf.debug/src/org/eclipse/dd/dsf/debug/service/IBreakpoints.java
> git rev-list -n 1 HEAD -- plugins/org.eclipse.dd.dsf.debug/src/org/eclipse/dd/dsf/debug/service/IBreakpoints.javaJB
But log does work for the file if follow is specified (output with
--diff-filter is empty...):
> git log --follow --oneline -- plugins/org.eclipse.dd.dsf.debug/src/org/eclipse/dd/dsf/debug/service/IBreakpoints.java
10580b5 Updated copyright statements.
17585c3 [218577] Cleaned up IBreakpoints interface.
...
Have I done something wrong in grafting history like this, or is this
just a problem with the way git log --follow tracks renames?
The repo's here if anyone's interested (it's 85M...):
git://github.com/jamesblackburn/org.eclipse.cdt
Many thanks for any insight.
Cheers,
James
next reply other threads:[~2011-06-15 22:42 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-15 22:41 James Blackburn [this message]
2011-06-16 13:25 ` git log --follow doesn't follow a rename over a merge Jakub Narebski
2011-06-16 13:31 ` James Blackburn
2011-06-16 17:01 ` James Blackburn
2011-06-16 17:45 ` Jeff King
2011-06-16 17:34 ` Jeff King
2011-06-16 17:59 ` Junio C Hamano
2011-06-16 18:15 ` Jeff King
2011-06-16 19:41 ` James Blackburn
2011-06-16 18:41 ` James Blackburn
2011-06-16 19:36 ` Junio C Hamano
2011-06-16 21:29 ` James Blackburn
2011-06-16 22:14 ` James Blackburn
2011-06-16 18:21 ` James Blackburn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=BANLkTimjEp0ntq80qttT9uZN2YGuhsnZBw@mail.gmail.com \
--to=jamesblackburn@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).