git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Petr Baudis <pasky@suse.cz>
To: linux@horizon.com
Cc: git@vger.kernel.org
Subject: Re: [ANNOUNCE] Git wiki
Date: Fri, 5 May 2006 20:15:41 +0200	[thread overview]
Message-ID: <20060505181540.GB27689@pasky.or.cz> (raw)
In-Reply-To: <20060505005659.9092.qmail@science.horizon.com>

Dear diary, on Fri, May 05, 2006 at 02:56:59AM CEST, I got a letter
where linux@horizon.com said that...
> But, as Linus has pointed out, this is a very partial solution which
> introduces a lot of difficulties elsewhere.  File renaming is a subset of
> the general class of code reorganizations.  Source files will be split,
> merged, and have functions moved back and forth.  You want the patch to
> find the code it applies to even if that code was moved.
> 
> And that can be done by taking a more global view of the patch.
> Identical file names is only a heuristic.  If the hunk on branch A
> can't find a place to apply on the same file in branch B, then
> you have to look a little harder, either at changes from branch B
> that introduce matching code elsewhere, or perhaps looking
> through history for a change that removed the match from the
> obvious place to see if it added a match elsewhere.

There are really two distinctions here which should be kept separate:
automatic vs. explicit movement tracking and file-level vs.
subfile-level movement tracking.

The automatic vs. explicit movement tracking is a lot more
controversial. Explicit movement tracking is pretty easy to provide for
file-level movements, it's just that the user says "I _did_ move file
A to file B" (I never got the Linus' argument that the user has no idea
- he just _performed_ the move, also explicitly, by calling *mv).

However, I guess the explicit movement tracking completely fails if you
go sub-file (without being extremely bothersome for the user) - you
would have to have control over the editor and the clipboard and even
then I'm not sure if you could reach any sensible results.

I still dislike automated movement tracking for whole files, but I'm
conciliated with it. Because it is probably the only really sensible way
to implement subfile-level tracking.  It would not be hard to implement
using pickaxe (actually, I believe it was near the top of Junio's TODO
few weeks ago) and a similarity detector comparing new and old version
(if it's dissimilar enough, check if that or a similar hunk was not
added somewhere else in the same commit; well, at least the idea
sounds simple).

One obvious problem are ambiguities - several similar files are renamed
to other similar files and now how do you decide which version to
choose? Merge the change to all the new files? Only to some? Panic?
I wonder how does the current recursive strategy deal with that.
Of course, this case sounds quite artificial and rare for whole files,
but I suspect that it will be much more common once you do not deal with
files but just hunks, moving bits of code around.

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
Right now I am having amnesia and deja-vu at the same time.  I think
I have forgotten this before.

  parent reply	other threads:[~2006-05-05 18:14 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-05  0:56 [ANNOUNCE] Git wiki linux
2006-05-05  6:22 ` Fredrik Kuivinen
2006-05-05  6:26   ` Jakub Narebski
2006-05-05  9:23   ` Petr Baudis
2006-05-05  9:51     ` Junio C Hamano
2006-05-05 16:40       ` Petr Baudis
2006-05-05 16:47       ` Jakub Narebski
2006-05-05 18:49         ` Jakub Narebski
2006-05-05 16:36 ` Petr Baudis
2006-05-05 17:48   ` Linus Torvalds
2006-05-05 19:04     ` Dave Jones
2006-05-05 18:15 ` Petr Baudis [this message]
2006-05-05 18:20   ` Petr Baudis
2006-05-05 18:27   ` Jakub Narebski
2006-05-05 18:31   ` Linus Torvalds
2006-05-05 18:54     ` Petr Baudis
2006-05-05 19:39       ` Jakub Narebski
2006-05-06 13:37         ` Jakub Narebski
2006-05-05 19:49       ` Junio C Hamano
2006-05-06  6:53         ` Martin Langhoff
2006-05-06  7:14           ` Junio C Hamano
2006-05-06  7:33           ` Jakub Narebski
2006-05-06  7:41             ` Junio C Hamano
2006-05-06 12:46               ` Bertrand Jacquin
2006-05-05 20:45   ` Olivier Galibert
  -- strict thread matches above, loose matches on Subject: below --
2006-05-02 23:25 Petr Baudis
2006-05-02 23:33 ` Junio C Hamano
2006-05-03  8:39   ` Paolo Ciarrocchi
2006-05-03  9:00     ` Petr Baudis
2006-05-03  9:13       ` Paolo Ciarrocchi
2006-05-03 13:41         ` Nicolas Pitre
2006-05-03 14:29           ` Shawn Pearce
2006-05-03 15:01             ` Andreas Ericsson
2006-05-03 15:24               ` Paolo Ciarrocchi
2006-05-03 15:30                 ` Jakub Narebski
2006-05-03 15:30               ` Linus Torvalds
2006-05-03 15:39                 ` Paolo Ciarrocchi
2006-05-03 16:06                   ` Linus Torvalds
2006-05-03 16:17                     ` Jakub Narebski
2006-05-03 16:19                       ` Paolo Ciarrocchi
2006-05-03 16:46                         ` Jakub Narebski
2006-05-03 19:21                       ` David Lang
2006-05-03 19:30                         ` Petr Baudis
2006-05-03 19:46                           ` David Lang
2006-05-03 20:07                             ` Petr Baudis
2006-05-04  0:53                           ` Daniel Barkalow
2006-05-03 16:47                 ` Theodore Tso
2006-05-03 17:06                   ` Linus Torvalds
2006-05-03 17:15                     ` Theodore Tso
2006-05-03 17:40                       ` Linus Torvalds
2006-05-03 22:39                     ` Sam Ravnborg
2006-05-03 22:46                       ` Petr Baudis
2006-05-03 22:50                         ` Joel Becker
2006-05-03 23:05                           ` Petr Baudis
2006-05-03 18:04                   ` Daniel Barkalow
     [not found]                   ` <20060503144522.7b5b7ba5.seanlkml@sympatico.ca>
2006-05-03 18:45                     ` sean
2006-05-03 20:58                 ` Junio C Hamano
2006-05-03 21:01                   ` Junio C Hamano
2006-05-03 22:13                   ` Linus Torvalds

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060505181540.GB27689@pasky.or.cz \
    --to=pasky@suse.cz \
    --cc=git@vger.kernel.org \
    --cc=linux@horizon.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).