From mboxrd@z Thu Jan 1 00:00:00 1970 From: Junio C Hamano Subject: Re: [PATCH] xdiff: Show function names in hunk headers. Date: Mon, 27 Mar 2006 21:54:25 -0800 Message-ID: <7vfyl3m7vy.fsf@assigned-by-dhcp.cox.net> References: <11435126113456-git-send-email-mdw@distorted.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: git@vger.kernel.org X-From: git-owner@vger.kernel.org Tue Mar 28 07:54:31 2006 Return-path: Envelope-to: gcvg-git@gmane.org Received: from vger.kernel.org ([209.132.176.167]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FO79y-0001Xu-F2 for gcvg-git@gmane.org; Tue, 28 Mar 2006 07:54:31 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751357AbWC1Fy1 (ORCPT ); Tue, 28 Mar 2006 00:54:27 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751351AbWC1Fy1 (ORCPT ); Tue, 28 Mar 2006 00:54:27 -0500 Received: from fed1rmmtao10.cox.net ([68.230.241.29]:53653 "EHLO fed1rmmtao10.cox.net") by vger.kernel.org with ESMTP id S1751357AbWC1Fy1 (ORCPT ); Tue, 28 Mar 2006 00:54:27 -0500 Received: from assigned-by-dhcp.cox.net ([68.4.9.127]) by fed1rmmtao10.cox.net (InterMail vM.6.01.05.02 201-2131-123-102-20050715) with ESMTP id <20060328055426.JORV20441.fed1rmmtao10.cox.net@assigned-by-dhcp.cox.net>; Tue, 28 Mar 2006 00:54:26 -0500 To: Mark Wooding In-Reply-To: <11435126113456-git-send-email-mdw@distorted.org.uk> (Mark Wooding's message of "Tue, 28 Mar 2006 03:23:31 +0100") User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (gnu/linux) Sender: git-owner@vger.kernel.org Precedence: bulk X-Mailing-List: git@vger.kernel.org Archived-At: Mark Wooding writes: > The function names are parsed by a particularly stupid algorithm at the > moment: it just tries to find a line in the `old' file, from before the > start of the hunk, whose first character looks plausible. Still, it's > most definitely a start. > + (isalpha((unsigned char)*rec) || /* identifier? */ > + *rec == '_' || /* also identifier? */ > + *rec == '(' || /* lisp defun? */ > + *rec == '#')) { /* #define? */ GNU diff -p does "^[[:alpha:]$_]"; personally I think any line that does not begin with a whitespace is good enough. In either way, your patch is good. Thanks.