From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: git@vger.kernel.org
Subject: Re: [BUG] diffcore-rename with duplicate tree entries can segfault
Date: Wed, 25 Feb 2015 13:50:38 -0800 [thread overview]
Message-ID: <xmqq1tldoe35.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <20150225214032.GA32295@peff.net> (Jeff King's message of "Wed, 25 Feb 2015 16:40:32 -0500")
Jeff King <peff@peff.net> writes:
> But we can also do that with a hash table, or an auxiliary sorted array.
> And sure enough, that's exactly what the rename_dst array is.
> ...
> which I think is a pretty simple and sane fix.
Yeah, good observation.
> So to go forward, I'm happy to prepare a patch, but I'd like to know:
>
> 1. Does something like the above look reasonable to you (I'd probably
> refactor it to avoid the bizarre return value semantics from
> locate_rename_dst, though)?
>
> 2. If so, do you want something minimal like what's above, or do you
> mind if I build it on top of a hashmap conversion? I suspect the
> logic may also end up more clear with the hashmap (since inserting
> versus lookup will be more distinct in the callers).
No, I don't mind. The diff-b-m topic seems to need a lot deeper
rethink than I originally anticipated anyway, and it can wait for a
clean-up to use hashmap to stabilize.
Thanks.
next prev parent reply other threads:[~2015-02-25 21:50 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-24 21:43 [BUG] diffcore-rename with duplicate tree entries can segfault Jeff King
2015-02-24 22:42 ` Junio C Hamano
2015-02-24 22:49 ` Jeff King
2015-02-24 23:11 ` Junio C Hamano
2015-02-24 23:47 ` Jeff King
2015-02-25 5:00 ` Junio C Hamano
2015-02-25 21:40 ` Jeff King
2015-02-25 21:50 ` Junio C Hamano [this message]
2015-02-27 1:38 ` [PATCH 0/2] " Jeff King
2015-02-27 1:39 ` [PATCH 1/2] diffcore-rename: split locate_rename_dst into two functions Jeff King
2015-02-27 1:42 ` [PATCH 2/2] diffcore-rename: avoid processing duplicate destinations Jeff King
2015-02-27 21:48 ` Junio C Hamano
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=xmqq1tldoe35.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.