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

Re: Rename handling

From
Jakub Narebski <jnareb@gmail.com>
Date
Mar 21, 2007, 00:06 UTC
Message-ID
<etpson$qih$1@sea.gmane.org>
In-Reply-To
<45FEE2B2.6050904@midwinter.com>
Steven Grimm wrote:
Show 31 quoted lines
> The following is actually my biggest beef with git's rename tracking, 
> and it has nothing whatsoever to do with git-log (though I agree git-log 
> needs to track renames too):
> 
> $ ls
> dir1
> $ ls dir1
> file1 file2 file3
> $ echo "#include file1" > dir1/file4
> $ git add dir1/file4
> $ git commit
> $ git pull
> $ ls
> dir1 dir2
> $ ls dir1
> file4
> $ ls dir2
> file1 file2 file3
> 
> That's just plain broken in my opinion. One can perhaps contrive a test 
> case or two where that's the desired behavior, but in the real world it 
> is almost never what you actually want.
> 
> By the way, I don't think fixing that is necessarily related to how 
> renames get detected, so in some sense it's a different bug report / 
> feature request than the rename hints one. It would be possible to 
> figure out the directory had been renamed based purely on content 
> analysis; a bunch of files all individually renamed to the same places 
> under a new directory, and a lack of any files at all left in the old 
> one, probably means the directory got renamed. The content-based rename 
> detector could handle this case.
 
Actually this came out in some earlier talk about recording renames 
and renames detection (IIRC in the big thread about VCS comparison which
used to be on Bazaar-NG wiki). And one of the arguments about why directory
rename doesn't work as _you_ expected is (beside that it is not that
easy to code) the fact that the alternate solution (new files going
to old subdir) can be correct and expected by _others_.
-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
Previous: Steven GrimmNext: Johannes Schindelin
Message 18 of 31 in “Rename handling”
  1. John GoerzenMar 19, 2007
  2. Steven GrimmMar 19, 2007
  3. Nicolas PitreMar 19, 2007
  4. Linus TorvaldsMar 19, 2007
  5. Steven GrimmMar 19, 2007
  6. Martin LanghoffMar 19, 2007
  7. Junio C HamanoMar 20, 2007
  8. Linus TorvaldsMar 19, 2007
  9. Robin RosenbergMar 19, 2007
  10. Linus TorvaldsMar 19, 2007
  11. Steven GrimmMar 19, 2007
  12. Steven GrimmMar 19, 2007
  13. Linus TorvaldsMar 19, 2007
  14. Nicolas PitreMar 19, 2007
  15. Daniel BarkalowMar 19, 2007
  16. Andy ParkinsMar 19, 2007
  17. Steven GrimmMar 19, 2007
  18. Jakub NarebskiMar 21, 2007
  19. Johannes SchindelinMar 21, 2007
  20. Steven GrimmMar 21, 2007
  21. Johannes SchindelinMar 21, 2007
  22. Linus TorvaldsMar 21, 2007
  23. Martin LanghoffMar 22, 2007
  24. Jakub NarebskiMar 22, 2007
  25. Martin LanghoffMar 22, 2007
  26. Jakub NarebskiMar 22, 2007
  27. Linus TorvaldsMar 22, 2007
  28. Daniel BarkalowMar 19, 2007
  29. John GoerzenMar 19, 2007
  30. Junio C HamanoMar 19, 2007
  31. Jakub NarebskiMar 21, 2007

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.