Re: How to tell if a file was renamed between two commits

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

 



Ron Garret <ron1@xxxxxxxxxxx> wrote:
> In article <20100203023219.GA13092@xxxxxxxxxxx>,
>  "Shawn O. Pearce" <spearce@xxxxxxxxxxx> wrote:
> > > So... is there an easy way to work around this?  Is there a way to get, 
> > > say, rev-list to tell me when the file it is tracking changed names?
> > 
> > Maybe use the -M flag to git log, or the --follow flag to
> > log/rev-list?
> 
> Nope.  git log --follow will follow through a name change but won't 
> actually say when the name changed happened or what the previous name of 
> the file was.
> 
> And actually playing around with it some more, it appears that git 
> rev-list doesn't actually track file renames, or at least it doesn't do 
> it all the time.  Weird.  I'm going to have to play around with this 
> some more.

Use:

  git log --format=%H -M --name-status --follow -- path 

I just tried it:

$ git log --format=%H -M --name-status --follow gerrit-prettify/src/main/resources/com/google/gerrit/prettify/client/prettify.js
8db22c85c49814b99639b2e6346583e9be4c289f

R100    gerrit-patch-gwtexpui/src/main/java/com/google/gwtexpui/safehtml/client/
544546fcd680f82a88df3e9eba7df8acfadf1e46

M       gerrit-patch-gwtexpui/src/main/java/com/google/gwtexpui/safehtml/client/
d83ac11a52c1b6d4acae932a8495daf1e9129fdf

R100    gerrit-patch-gwtexpui/src/main/java/com/google/gwtexpui/safehtml/public/
44671f5c6929a8f05223dd359182610286ceb98a

R100    src/main/java/com/google/gerrit/public/prettify20090521/prettify.js     
56fc9e3d951b0886c4781a5c8623dbc3da824f30

A       src/main/java/com/google/gerrit/public/prettify20090521/prettify.js


Yay, its been renamed 3 times in its life here.  :-)

-- 
Shawn.
--
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]