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

Re: [PATCH] Introduce patch factorization in diffcore.

From
Yann Dirson <ydirson@altern.org>
Date
Sep 26, 2008, 19:21 UTC
Message-ID
<20080926192108.GC17458@nan92-1-81-57-214-146.fbx.proxad.net>
In-Reply-To
<48DC133A.7010805@op5.se>
On Fri, Sep 26, 2008 at 12:39:54AM +0200, Andreas Ericsson wrote:
Show 7 quoted lines
> Yann Dirson wrote:
>>  "                try unchanged files as candidate for copy detection.\n" \
>> +"  --factorize_renames\n" \
>> +"                factorize renames of all files of a directory.\n" \
>
>
> Use dashes to separate words in arguments, please.

Fortunately, the typo only made it to the help string, thanks for catching it :)

Show 12 quoted lines
>>  +#include <libgen.h>
>> +
>
> +#ifdef basename
> +# undef basename
> +#endif
>
> We might as well use the GNU version of basename() at least. Even if
> you don't use it, I'd rather not see this bite some unwary programmer
> coming along after you. Worst case scenario, sha1's won't add up if
> POSIX basename alters its argument, making for one fiendishly tricky
> bug to find.
I'll look into that, thanks
Show 12 quoted lines
>> +/*
>> + * FIXME: we could optimize the 100%-rename case by preventing
>> + * recursion to unfold what we know we would refold here.
>> + * FIXME: do we want to replace linked list with sorted array ?
>
> Either that or a hash. Most of the time seems to be spent in lookups.
> With a hash you get quick lookups and reasonably quick inserts. With
> a sorted array you get lower memory footprint than anything else and
> can bisect your way to the right entry, which performs reasonably
> close to skiplists. The sort overhead might be a deterrant factor,
> but insofar as I understand it trees are always sorted in git anyway,
> so perhaps that'd be the best solution.

Thanks for this insight - I'll wait before changing the data structure, since the current implementation may need to be able to recurse (consider renamed subdirs as well as renamed files).

Show 5 quoted lines
> Apart from that, I'd need to apply the patch to review it properly,
> and I'm far too tired for that now.
>
> I like the direction this is going though, so thanks a lot for doing
> it :)
Great :)
Best regards,
-- 
Yann
Previous: Andreas EricssonNext: Jakub Narebski
Message 7 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.