From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeff King Subject: Re: [bug] blame duplicates trailing ">" in mailmapped emails Date: Sun, 5 Feb 2012 18:50:44 -0500 Message-ID: <20120205235044.GB28735@sigill.intra.peff.net> References: <7v8vklvxwh.fsf@alter.siamese.dyndns.org> <7vhaz8vkhd.fsf@alter.siamese.dyndns.org> <7vehuboe5g.fsf@alter.siamese.dyndns.org> <20120204182611.GA31091@sigill.intra.peff.net> <20120204232015.GB1170@sigill.intra.peff.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Cc: Junio C Hamano , Jonathan Nieder , git@vger.kernel.org, SZEDER =?utf-8?B?R8OhYm9y?= To: Felipe Contreras X-From: git-owner@vger.kernel.org Mon Feb 06 00:50:51 2012 Return-path: Envelope-to: gcvg-git-2@plane.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RuBr8-00087p-QN for gcvg-git-2@plane.gmane.org; Mon, 06 Feb 2012 00:50:51 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754063Ab2BEXuq (ORCPT ); Sun, 5 Feb 2012 18:50:46 -0500 Received: from 99-108-226-0.lightspeed.iplsin.sbcglobal.net ([99.108.226.0]:58447 "EHLO peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753260Ab2BEXuq (ORCPT ); Sun, 5 Feb 2012 18:50:46 -0500 Received: (qmail 20743 invoked by uid 107); 5 Feb 2012 23:57:52 -0000 Received: from sigill.intra.peff.net (HELO sigill.intra.peff.net) (10.0.0.7) (smtp-auth username relayok, mechanism cram-md5) by peff.net (qpsmtpd/0.84) with ESMTPA; Sun, 05 Feb 2012 18:57:52 -0500 Received: by sigill.intra.peff.net (sSMTP sendmail emulation); Sun, 05 Feb 2012 18:50:44 -0500 Content-Disposition: inline In-Reply-To: Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: On Sun, Feb 05, 2012 at 11:11:20PM +0200, Felipe Contreras wrote: > > 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