Subject: Re: [RFC PATCH] detection of directory renames

From: Jakub Narebski <[email-masked]>
Date: Thu, 25 Sep 2008 16:19:20 -0700 (PDT)

Yann Dirson <[email-masked]> writes:

> This is a first very preliminar patch, mostly so people can comment
> early on the big picture.  It has a number of limitations, many but
> not all already listed as FIXME's in the patch itself.  If anything in
> this patch seems so wrong it is not worth polishing it, it's the
> perfect time to say so :)
> 
> The idea is to add a new pass to diffcore-rename, to group file renames
> looking like a full directory move, and then to hide those file
> renames which do not carry any additionnal information.
> 
> Here is a sample run:
> 
> $ ./git-diff-tree ee491 --factorize-renames -r 
> [DBG] possible rename from arm/ to bar/
> [DBG] possible rename from ppc/ to moved/
> [DBG] discarding dir rename of arm/, mixing moved/ and bar/
> [DBG] ppc/* -> moved/* makes ppc/sha1ppc.S -> moved/sha1ppc.S uninteresting
> [DBG] ppc/* -> moved/* makes ppc/sha1.c -> moved/sha1.c uninteresting
> ee491a42190ec6e716f46a55fa0a7f4e307f1629
> :040000 040000 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000 R100   ppc/    moved/
> :100644 100644 9e3ae038e818f4e21bc50f864fc5204f6fa44daa 9e3ae038e818f4e21bc50f864fc5204f6fa44daa R100   arm/sha1.c      bar/sha1.c
> :100644 100644 3952646349cf9d033177e69ba9433652a378c0e9 3952646349cf9d033177e69ba9433652a378c0e9 R100   arm/sha1.h      bar/sha1.h
> :100644 100644 c3c51aa4d487f2e85c02b0257c1f0b57d6158d76 c065eeef7d68ea91863431788e20cd814c5ac52c R099   ppc/sha1.h      moved/sha1.h
> :100644 100644 8c1cb99fb403875af85e4d1524d21f7eb818f59b 8c1cb99fb403875af85e4d1524d21f7eb818f59b R100   arm/sha1_arm.S  moved/sha1_arm.S

Wonderfull!!!

I like it very much, and hope that it would get improved. And that you
would be able to use it in merges too, to allow for example for new
files to be created in renamed directory instead of old one which does
not exist any longer (c.f. http://www.markshuttleworth.com/archives/123
and following articles).

For the future, could you show examples with --abbrev option in use? TIA.
-- 
Jakub Narebski
Poland
ShadeHawk on #git