* [RFC/PATCH] rename: warn user when we have turned off rename detection
@ 2008-03-01 6:14 Jeff King
2008-03-01 7:35 ` Junio C Hamano
0 siblings, 1 reply; 4+ messages in thread
From: Jeff King @ 2008-03-01 6:14 UTC (permalink / raw)
To: git; +Cc: Junio C Hamano, Linus Torvalds
Signed-off-by: Jeff King <peff@peff.net>
---
This was another patch from late in the freeze period. It was in
response to a user getting confused about why rename detection wasn't
happening in a large merge. Is it appropriate to print this for every
rename we try? Or should it just be for merges?
Perhaps we should also bump the default limit from 100, which I think
was just arbitrarily chosen. I posted some numbers in:
http://mid.gmane.org/20080211113516.GB6344@coredump.intra.peff.net
which imply that 200-400 is probably a more reasonable value. Thoughts?
diffcore-rename.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/diffcore-rename.c b/diffcore-rename.c
index 3d37725..31941bc 100644
--- a/diffcore-rename.c
+++ b/diffcore-rename.c
@@ -468,10 +468,11 @@ void diffcore_rename(struct diff_options *options)
*/
if (rename_limit <= 0 || rename_limit > 32767)
rename_limit = 32767;
- if (num_create > rename_limit && num_src > rename_limit)
- goto cleanup;
- if (num_create * num_src > rename_limit * rename_limit)
+ if ((num_create > rename_limit && num_src > rename_limit) ||
+ (num_create * num_src > rename_limit * rename_limit)) {
+ warning("too many files, skipping inexact rename detection");
goto cleanup;
+ }
mx = xmalloc(sizeof(*mx) * num_create * num_src);
for (dst_cnt = i = 0; i < rename_dst_nr; i++) {
--
1.5.4.3.422.g55194
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [RFC/PATCH] rename: warn user when we have turned off rename detection
2008-03-01 6:14 [RFC/PATCH] rename: warn user when we have turned off rename detection Jeff King
@ 2008-03-01 7:35 ` Junio C Hamano
2008-03-01 8:18 ` Jeff King
0 siblings, 1 reply; 4+ messages in thread
From: Junio C Hamano @ 2008-03-01 7:35 UTC (permalink / raw)
To: Jeff King; +Cc: git, Linus Torvalds
Jeff King <peff@peff.net> writes:
> Signed-off-by: Jeff King <peff@peff.net>
> ---
> This was another patch from late in the freeze period. It was in
> response to a user getting confused about why rename detection wasn't
> happening in a large merge. Is it appropriate to print this for every
> rename we try? Or should it just be for merges?
>
> Perhaps we should also bump the default limit from 100, which I think
> was just arbitrarily chosen.
> ...
> + if ((num_create > rename_limit && num_src > rename_limit) ||
> + (num_create * num_src > rename_limit * rename_limit)) {
> + warning("too many files, skipping inexact rename detection");
> goto cleanup;
> + }
>
> mx = xmalloc(sizeof(*mx) * num_create * num_src);
> for (dst_cnt = i = 0; i < rename_dst_nr; i++) {
This reminds me of the 6d24ad9 (Optimize rename detection for a huge diff)
topic that reduces the above allocation greatly. Some benching with the
patch may prove useful to establish much higher limits, I suspect.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [RFC/PATCH] rename: warn user when we have turned off rename detection
2008-03-01 7:35 ` Junio C Hamano
@ 2008-03-01 8:18 ` Jeff King
2008-03-01 9:30 ` Junio C Hamano
0 siblings, 1 reply; 4+ messages in thread
From: Jeff King @ 2008-03-01 8:18 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, Linus Torvalds
On Fri, Feb 29, 2008 at 11:35:00PM -0800, Junio C Hamano wrote:
> > + if ((num_create > rename_limit && num_src > rename_limit) ||
> > + (num_create * num_src > rename_limit * rename_limit)) {
> > + warning("too many files, skipping inexact rename detection");
> > goto cleanup;
> > + }
> >
> > mx = xmalloc(sizeof(*mx) * num_create * num_src);
> > for (dst_cnt = i = 0; i < rename_dst_nr; i++) {
>
> This reminds me of the 6d24ad9 (Optimize rename detection for a huge diff)
> topic that reduces the above allocation greatly. Some benching with the
> patch may prove useful to establish much higher limits, I suspect.
Actually, my timings are about the same. While the patch you mentioned
is nice for reducing the memory consumption, we still have an O(n^2)
loop.
-Peff
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [RFC/PATCH] rename: warn user when we have turned off rename detection
2008-03-01 8:18 ` Jeff King
@ 2008-03-01 9:30 ` Junio C Hamano
0 siblings, 0 replies; 4+ messages in thread
From: Junio C Hamano @ 2008-03-01 9:30 UTC (permalink / raw)
To: Jeff King; +Cc: git, Linus Torvalds
Jeff King <peff@peff.net> writes:
>> This reminds me of the 6d24ad9 (Optimize rename detection for a huge diff)
>> topic that reduces the above allocation greatly. Some benching with the
>> patch may prove useful to establish much higher limits, I suspect.
>
> Actually, my timings are about the same. While the patch you mentioned
> is nice for reducing the memory consumption, we still have an O(n^2)
> loop.
Yeah, that one was not about the time but about the space, so it is
expected.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-03-01 9:32 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-01 6:14 [RFC/PATCH] rename: warn user when we have turned off rename detection Jeff King
2008-03-01 7:35 ` Junio C Hamano
2008-03-01 8:18 ` Jeff King
2008-03-01 9:30 ` Junio C Hamano
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).