Subject: Re: file rename causes history to disappear

From: Jeff Garzik <[email-masked]>
Date: Wed, 06 Sep 2006 11:46:19 -0400

Linus Torvalds wrote:
> 
> On Wed, 6 Sep 2006, Jeff Garzik wrote:
>> I moved a bunch of SATA drivers in the Linux kernel from drivers/scsi to
>> drivers/ata.
>>
>> When I tried to look at the past history of a file using git-whatchanged,
>> post-rename, it only shows the history from HEAD to the point of rename.
>> Everything prior to the rename is lost.
>>
>> I also tried git-whatchanged on the old path, but that produces an error.
> 
> For filenames that don't exist right now, you need to clearly separate the 
> revision name from the filename (ie you need to use "--").
> 
> There were patches to do "--follow-rename" which I don't think got applied 
> yet, but in the meantime, just do
> 
> 	git whatchanged -M -- drivers/ata/filename.c drivers/scsi/filename.c
> 
> where the "-M" means "show diffs as renames if possible" (which is 
> different from having the history actually _follow_ them), and the "--" is 
> the filename separator to tell git that the nonexistent 
> "drivers/ata/filename.c" file isn't a (currently) nonexistent revision 
> name, it's a (currently) nonexistent _filename_.

Since I'm just interested in the log (ATM), even the lack of "-M" seems 
to produce useful results.  Thanks.

IMO it is highly counter-intuitive that renames are -not- followed.  I 
don't see the point of a "--follow-rename", it should Just Work(tm).

	Jeff