Re: [bug] blame duplicates trailing ">" in mailmapped emails
- From
Jeff King <peff@peff.net>
- Date
- Feb 5, 2012, 23:50 UTC
- Message-ID
- <20120205235044.GB28735@sigill.intra.peff.net>
- In-Reply-To
- <CAMP44s0xmvjxsE6AYrA5qTZuDfWq8vPDPOo69hiRS+xWbsbS7g@mail.gmail.com>
On Sun, Feb 05, 2012 at 11:11:20PM +0200, Felipe Contreras wrote:
Show 10 quoted lines
> > Because of the calling convention of map_user, the buffer with the input
> > must also be writable (since it holds the result). So there should be no
> > loss of efficiency to convert the ">" into a "\0" (and in fact, the
> > simplest fix is probably to just have map_user "tie off" any ">" it
> > detects).
>
> Yes, but then the caller (git blame) would need to _always_ do that
> conversion before (">" -> "\0"), and after ("\0" -> ">"), as opposed
> to now, that it does the conversion only when map_user succeeds (or
> checks if it has to do it).Yes, I'm talking about changing the calling and return conventions of map_user. I think the efficiency change is negligible, though, as we are talking about character assignments (and in fact, it would probably end up more efficient, as we could eliminate some copying inside map_user). But Junio's patch is simple, and fixes the problem without creating any complexity for the callers. So I think it's a good fix.
-Peff