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

Re: Tracking files across tree reorganizations

From
Petr Baudis <pasky@suse.cz>
Date
Dec 14, 2005, 23:45 UTC
Message-ID
<20051214234504.GL22159@pasky.or.cz>
In-Reply-To
<43A0A6E1.9070903@zytor.com>

Dear diary, on Thu, Dec 15, 2005 at 12:12:33AM CET, I got a letter where "H. Peter Anvin" <hpa@zytor.com> said that...

Show 13 quoted lines
> Petr Baudis wrote:
> >Hah, here we go again. :-)
> >
> >Dear diary, on Wed, Dec 14, 2005 at 10:15:59PM CET, I got a letter
> >where "H. Peter Anvin" <hpa@zytor.com> said that...
> >
> >>Did anything ever happen with that?
> >
> >Linus is against it.
> >
> 
> I don't think so.  Linus is against the user having to explicitly record 
> the moves, but we can detect the moves at the point of reorganization.
Linus' <Pine.LNX.4.58.0504150753440.7211@ppc970.osdl.org>:
 - you're doing the work at the wrong point for _another_ reason. You're
   freezing your (crappy) algorithm at tree creation time, and basically
   making it pointless to ever create something better later, because
   even if hardware and software improves, you've codified that "we have
   to have crappy information".
  I tend to agree with this now - although I disagree about his
performance point in the mail; but we can cache the autodetection
results out of commit objects to improve the performance, if it's
worth it (and I suspect it actually isn't, if you don't care about
the "A renamed to B and new A introduced, both in the same commit"
case).
  Note that the intent of the explicit rename recording is to really
record file reorganizations, not code refactoring. When you just
reorganize your tree, Linus' "meaningless special case" becomes very
meaningful, because at such point all the code inside the file travels.
But if you just move big chunks of code around and rename files based on
prevailing code origin or something (that's a weird thing to do but I've
seen people do it), then that's probably where the file as a whole
shouldn't be marked renamed.
  To encourage this practice, I might check the similarities of the
renamed files at the time of recording them, and print a big fat warning
to the user if it's less than say 90% or so. But I think that the huge
majority of cases where people want to rename is when they reorganize
their trees and move files as a whole, and that's why it's so useful
to support explicit renames recording.
Show 12 quoted lines
> >Cogito will do it anyway ;-), when someone sends me a nice patch or when
> >I get to it (probably not very soon). I imagine it like this:
> >
> >(a) User can explicitly note file moves / renames. We follow those notes.
> >Probably the most viable for recording the notes is appending them at
> >the tail of the commit message.
> >
> >(b) If there are no notes for the given commit, we do the rename
> >autodetection already implemented in GIT. If it yields something,
> >we follow it.
> 
> I don't see anything in Linus' posts that says (b) is unacceptable.
  If we do it at the walk time, not commit time - I didn't emphasize
that in my previous mail while I should have.
-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
VI has two modes: the one in which it beeps and the one in which
it doesn't.
Previous: H. Peter AnvinNext: H. Peter Anvin
Message 4 of 13 in “Tracking files across tree reorganizations”
  1. H. Peter AnvinDec 14, 2005
  2. Petr BaudisDec 14, 2005
  3. H. Peter AnvinDec 14, 2005
  4. Petr BaudisDec 14, 2005
  5. H. Peter AnvinDec 14, 2005
  6. Linus TorvaldsDec 14, 2005
  7. H. Peter AnvinDec 14, 2005
  8. Junio C HamanoDec 15, 2005
  9. H. Peter AnvinDec 15, 2005
  10. Petr BaudisDec 15, 2005
  11. Martin LanghoffDec 15, 2005
  12. Martin LanghoffDec 15, 2005
  13. H. Peter AnvinDec 15, 2005

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.