Re: git blame --follow

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

 



On Dienstag 15 März 2011, Junio C Hamano wrote:
> Wolfgang Rohdewald <wolfgang@xxxxxxxxxxxx> writes:
> > git log --follow filename
> > 
> > shows the full history, while
> > 
> > git blame --follow filename
> > 
> > blames everything to the latest commit (which was
> > a file rename)
> 
> Huh?
> 
>     $ git checkout master^0
>     $ git mv COPYING RENAMING
>     $ git commit -m renamed
>     $ git blame --follow RENAMING
> 
> gives everything blamed to 075b845a COPYING (but that is
> probably by accident, see below).  FYI,
> 
>     $ git blame RENAMING
> 
> should also blame everything to the same commit and the same
> COPYING file. If you get a different behaviour out of the
> above command sequence, there is something else going on.

I get the same - except that only most is attributed to 075b845a,
some is attributed to 703601d6. But git blame and git
blame --follow return the same output with your example

> I didn't know "blame" even accepted "--follow".  It is
> entirely out of the scope of its design to take "--follow"
> option, as the "blame" command itself has its own and real
> "follow" logic that is enabled by default (i.e. it follows a
> whole file rename without any option)

so if I rename a parent directory of myfile and do git blame 
myfile, blaming should ignore the renaming. This works
with the git repo

git mv xdiff xxx
git ci -m'mv xdiff xxx'
cd xxx
git blame xemit.c

But with my repository (which I cannot share),
this does not happen. git blame attributes everything to 
the renaming commit. If I checkout the commit before, git
blame shows everything correctly.

So there must be something special with my repo. How could
I debug that? BTW the renaming happened in svn, it is the
last svn commit for this file before I imported this svn
repo into git (like described in the Pro Git book)

And - for directories below the renamed one git log --follow 
cannot cross this barrier either but if the "follow" logic
is different I suppose this is not related

-- 
Wolfgang
--
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]