From: Petr Baudis <pasky@suse.cz>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: Tracking files across tree reorganizations
Date: Thu, 15 Dec 2005 00:45:04 +0100 [thread overview]
Message-ID: <20051214234504.GL22159@pasky.or.cz> (raw)
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...
> 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.
> >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.
next prev parent reply other threads:[~2005-12-14 23:45 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-12-14 21:15 Tracking files across tree reorganizations H. Peter Anvin
2005-12-14 22:36 ` Petr Baudis
2005-12-14 23:12 ` H. Peter Anvin
2005-12-14 23:45 ` Petr Baudis [this message]
2005-12-14 23:47 ` H. Peter Anvin
2005-12-14 23:39 ` Linus Torvalds
2005-12-14 23:44 ` H. Peter Anvin
2005-12-15 0:36 ` Junio C Hamano
2005-12-15 1:02 ` H. Peter Anvin
2005-12-15 1:44 ` Petr Baudis
2005-12-15 5:40 ` Martin Langhoff
2005-12-15 5:38 ` Martin Langhoff
2005-12-15 8:12 ` H. Peter Anvin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20051214234504.GL22159@pasky.or.cz \
--to=pasky@suse.cz \
--cc=git@vger.kernel.org \
--cc=hpa@zytor.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).