From: Andreas Ericsson <ae@op5.se>
To: Yann Dirson <ydirson@altern.org>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] Introduce patch factorization in diffcore.
Date: Fri, 26 Sep 2008 00:39:54 +0200 [thread overview]
Message-ID: <48DC133A.7010805@op5.se> (raw)
In-Reply-To: <20080925214707.27029.36260.stgit@gandelf.nowhere.earth>
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.
>
> +#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.
> +/*
> + * 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.
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 :)
--
Andreas Ericsson andreas.ericsson@op5.se
OP5 AB www.op5.se
Tel: +46 8-230225 Fax: +46 8-230231
next prev parent reply other threads:[~2008-09-25 22:41 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-01 21:39 diffcore and directory renames Yann Dirson
2008-09-01 22:50 ` Junio C Hamano
2008-09-02 20:48 ` Yann Dirson
2008-09-25 21:47 ` [RFC PATCH] detection of " Yann Dirson
2008-09-25 21:47 ` [PATCH] Introduce patch factorization in diffcore Yann Dirson
2008-09-25 22:39 ` Andreas Ericsson [this message]
2008-09-26 19:21 ` Yann Dirson
2008-09-25 23:19 ` [RFC PATCH] detection of directory renames Jakub Narebski
2008-09-26 19:06 ` Yann Dirson
2008-10-27 13:35 ` Jakub Narebski
2008-10-27 19:13 ` Yann Dirson
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=48DC133A.7010805@op5.se \
--to=ae@op5.se \
--cc=git@vger.kernel.org \
--cc=ydirson@altern.org \
/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.
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 NNTP newsgroup(s).