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

Re: Following renames

From
THTimo Hirvonen <tihirvon@gmail.com>
Date
Mar 26, 2006, 16:08 UTC
Message-ID
<20060326190836.dbe95a72.tihirvon@gmail.com>
In-Reply-To
<7virq1sywj.fsf@assigned-by-dhcp.cox.net>

On Sat, 25 Mar 2006 18:49:48 -0800 Junio C Hamano <junkio@cox.net> wrote:

> Looking at the evolution of rev-list.c file itself was a good
> exercise to realize that rename tracking (more specifically,
> having whatchanged to follow renames) is not such a useful
> thing (at least for me).

It would be useful for me. I had all files organized in subdirectories, but then noticed it was not good idea because make does not play nicely with subdirs, so I moved all files to top level directory.

Now
    git-whatchanged -p file.c
stops at the big rename. To continue I have to do
    git-whatchanged -p -- <some-commit> <old-filename>
Show 7 quoted lines
> Another example.  Today's tar-tree updates have one interesting
> function I think should belong to strbuf.c, and before merging
> it to the mainline, I may move that function from tar-tree.c to
> strbuf.c.  After that happens, if I run "whatchanged strbuf.c"
> to see where that function came from, I would want it to notice
> it came from tar-tree.c, although it is not a rename at all.
> Just one function moved from a file to another.
Yes in this case you can do

$ git-whatchanged strbuf.c $ git-whatchanged tar-tree.c

but after rename...

$ git-whatchanged old-file.c fatal: 'old-file.c': No such file or directory

$ touch old-file.c $ git-whatchanged old-file.c

Hah, it worked!
Hmm... this works too without the touch-hack:
$ git-whatchanged file.c old-file.c
I wish I had known this before.
Show 9 quoted lines
> What this suggests is that switching the set of paths to follow
> while traversing ancestry chain needs to depend on which part of
> the original file you are interested in.  Marking "this commit
> renames (or copies) file A to file B" is not that useful -- for
> that matter, detecting at runtime like we currently do is not
> better either.  If a file A and file B were cleaned up and
> merged into a single file C, which is in the tip of the tree,
> which one you would want whatchanged to switch following depends
> on which part of the C you were interested in.

OK, maybe following renames is not such a good idea. But for GUIs (gitk, qgit) following renames or even file merges (select a file to follow by clicking it) would be big plus.

-- 
http://onion.dynserv.net/~timo/
Previous: Petr BaudisNext: Linus Torvalds
Message 7 of 41 in “Following renames”
  1. Petr BaudisMar 26, 2006
  2. Junio C HamanoMar 26, 2006
  3. Jakub NarebskiMar 26, 2006
  4. Paul JakmaMar 27, 2006
  5. Petr BaudisMar 26, 2006
  6. Petr BaudisMar 26, 2006
  7. Timo HirvonenMar 26, 2006
  8. Linus TorvaldsMar 26, 2006
  9. Jakub NarebskiMar 26, 2006
  10. Linus TorvaldsMar 26, 2006
  11. Jakub NarebskiMar 26, 2006
  12. Linus TorvaldsMar 26, 2006
  13. Marco CostalbaMar 26, 2006
  14. Linus TorvaldsMar 26, 2006
  15. Marco CostalbaMar 27, 2006
  16. Junio C HamanoMar 27, 2006
  17. Linus TorvaldsMar 27, 2006
  18. Marco CostalbaMar 27, 2006
  19. Johannes SchindelinMar 27, 2006
  20. Linus TorvaldsMar 27, 2006
  21. Marco CostalbaMar 27, 2006
  22. Andreas EricssonMar 27, 2006
  23. Jakub NarebskiMar 27, 2006
  24. David LangMar 27, 2006
  25. Jakub NarebskiMar 27, 2006
  26. Linus TorvaldsMar 26, 2006
  27. Ryan AndersonMar 26, 2006
  28. Petr BaudisMar 26, 2006
  29. Fredrik KuivinenMar 26, 2006
  30. Linus TorvaldsMar 26, 2006
  31. Petr BaudisMar 26, 2006
  32. Petr BaudisMar 26, 2006
  33. Linus TorvaldsMar 26, 2006
  34. Petr BaudisMar 26, 2006
  35. Junio C HamanoMar 26, 2006
  36. Linus TorvaldsMar 26, 2006
  37. Junio C HamanoMar 27, 2006
  38. Linus TorvaldsMar 26, 2006
  39. Petr BaudisMar 26, 2006
  40. Petr BaudisMar 27, 2006
  41. Petr BaudisMar 26, 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.