git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: file rename causes history to disappear

From
JGJeff Garzik <jeff@garzik.org>
Date
Sep 6, 2006, 15:46 UTC
Message-ID
<44FEED4B.30909@garzik.org>
In-Reply-To
<Pine.LNX.4.64.0609060834520.27779@g5.osdl.org>
Linus Torvalds wrote:
Show 24 quoted lines
> 
> 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
Previous: Linus TorvaldsNext: Linus Torvalds
Message 4 of 16 in “file rename causes history to disappear”
  1. Jeff GarzikSep 6, 2006
  2. Timo HirvonenSep 6, 2006
  3. Linus TorvaldsSep 6, 2006
  4. Jeff GarzikSep 6, 2006
  5. Linus TorvaldsSep 6, 2006
  6. Linus TorvaldsSep 6, 2006
  7. Junio C HamanoSep 6, 2006
  8. Randal L. SchwartzSep 6, 2006
  9. Junio C HamanoSep 7, 2006
  10. Alex RiesenSep 7, 2006
  11. Jakub NarebskiSep 6, 2006
  12. Linus TorvaldsSep 6, 2006
  13. Jakub NarebskiSep 6, 2006
  14. Linus TorvaldsSep 6, 2006
  15. Junio C HamanoSep 6, 2006
  16. Jakub NarebskiSep 6, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.