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

[RFC PATCH] detection of directory renames

From
Yann Dirson <ydirson@altern.org>
Date
Sep 25, 2008, 21:47 UTC
Message-ID
<20080925213819.27029.47944.stgit@gandelf.nowhere.earth>
In-Reply-To
<7vfxojtr9t.fsf@gitster.siamese.dyndns.org>

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

-- 
Yann Dirson    <ydirson@altern.org> |
Debian-related: <dirson@debian.org> |   Support Debian GNU/Linux:
                                    |  Freedom, Power, Stability, Gratis
     http://ydirson.free.fr/        | Check <http://www.debian.org/>
Previous: Yann DirsonNext: Yann Dirson
Message 4 of 11 in “diffcore and directory renames”
  1. Yann DirsonSep 1, 2008
  2. Junio C HamanoSep 1, 2008
  3. Yann DirsonSep 2, 2008
  4. detection of directory renamesYann Dirson, Sep 25, 2008
  5. Introduce patch factorization in diffcore.Yann Dirson, Sep 25, 2008
  6. Andreas EricssonSep 25, 2008
  7. Yann DirsonSep 26, 2008
  8. Jakub NarebskiSep 25, 2008
  9. Yann DirsonSep 26, 2008
  10. Jakub NarebskiOct 27, 2008
  11. Yann DirsonOct 27, 2008

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.