git log --follow doesn't follow a rename over a merge

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]