Re: git-pull - strange (copy/rename) messages ?!

From: Linus Torvalds <torvalds@osdl.org>
Date: 2005-11-02 03:10:53
On Tue, 1 Nov 2005, Duncan Mac Leod wrote:
>
> One Team-Member of our dev.-team has deleted one file called
> Graphics/PaletteGroups.cs in our shared git repository.
> 
> As I updated my working dir with git-pull I noticed some strange messages...
> 
> What do these many copy and rename messages below the summary '14 files
> changed, 933 insertions(+), 263 deletions(-)' mean ????

First off, you should realize that whenever git says "copy" or "rename", 
it never actually tracked the data at that level. git itself never did a 
copy or rename operation at all, it just tracked your data contents.

However, the normal "git pull" will show purely for your edification what 
git thinks the other end did to get to that data content. And it does so 
with copy and rename detection enabled, so in this case it says:

>  copy Graphics/{PaletteGroups.cs => PaletteCategories.cs} (80%)
>  copy Graphics/PaletteGroups.cs => Plot/Dialogs/Dialog.cs (75%)
>  copy Graphics/PaletteGroups.cs => Plot/Dialogs/DialogEntry.cs (74%)
>  copy Graphics/PaletteGroups.cs => Plot/Dialogs/DialogSection.cs (64%)
>  copy Graphics/PaletteGroups.cs => Plot/Journals/Journal.cs (75%)
>  copy Graphics/PaletteGroups.cs => Plot/Journals/JournalEntry.cs (73%)
>  copy Graphics/PaletteGroups.cs => Plot/Journals/JournalSection.cs (64%)
>  copy Graphics/PaletteGroups.cs => Runtime/CompilerServices/eScriptCompiler.cs (74%)
>  copy Graphics/PaletteGroups.cs => Runtime/Scripting/Script.cs (75%)
>  rename Graphics/PaletteGroups.cs => Runtime/Scripting/ScriptLibrary.cs (64%)

Which means that git notices that there are a number of new files, and the 
new files all bear a striking resemblance to one file that was deleted.

So it tells you that the new files are probably copies of the old one 
(with one final "rename", since the old file doesn't actually exist any 
more).

Which may or may not be true, of course. But even if it's not "true", it's 
still interesting information - it is a totally objective "those new files 
look like the old file" thing. In other words, it tells you something 
true about the file contents.

To some degree it would be much more interesting to have 
"--find-copies-harder" enabled (which it isn't), which gives better copy 
information for new files (it also looks at _unchanged_ old files). 
However, that's prohibitively expensive for big projects, so it's not on 
by default.

Btw, Junio, I thought "git pull" was only supposed to do rename 
detection, not copy detection.

			Linus
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Wed Nov 02 03:15:16 2005

This archive was generated by hypermail 2.1.8 : 2005-11-02 03:15:20 EST