From mboxrd@z Thu Jan 1 00:00:00 1970 From: SZEDER =?iso-8859-1?Q?G=E1bor?= Subject: Re: [PATCH v2] commit, status: #comment diff output in verbose mode Date: Fri, 11 Mar 2011 00:57:03 +0100 Message-ID: <20110310235703.GA15629@neumann> References: <1299787140-21472-1-git-send-email-icomfort@stanford.edu> <20110310225233.GH15828@sigill.intra.peff.net> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Ian Ward Comfort , To: Jeff King X-From: git-owner@vger.kernel.org Fri Mar 11 00:57:17 2011 Return-path: Envelope-to: gcvg-git-2@lo.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PxpjI-0007KZ-9K for gcvg-git-2@lo.gmane.org; Fri, 11 Mar 2011 00:57:16 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754299Ab1CJX5I convert rfc822-to-quoted-printable (ORCPT ); Thu, 10 Mar 2011 18:57:08 -0500 Received: from ex-e-1.perimeter.fzi.de ([141.21.8.250]:42930 "EHLO EX-E-1.perimeter.fzi.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754305Ab1CJX5H (ORCPT ); Thu, 10 Mar 2011 18:57:07 -0500 Received: from ex-ca-ht-1.fzi.de (141.21.32.98) by EX-E-1.perimeter.fzi.de (141.21.8.250) with Microsoft SMTP Server (TLS) id 14.1.270.1; Fri, 11 Mar 2011 00:57:03 +0100 Received: from localhost6.localdomain6 (91.19.9.156) by ex-ca-ht-1.fzi.de (141.21.32.98) with Microsoft SMTP Server (TLS) id 14.1.270.1; Fri, 11 Mar 2011 00:57:04 +0100 Content-Disposition: inline In-Reply-To: <20110310225233.GH15828@sigill.intra.peff.net> User-Agent: Mutt/1.5.20 (2009-06-14) Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: On Thu, Mar 10, 2011 at 05:52:33PM -0500, Jeff King wrote: > On Thu, Mar 10, 2011 at 11:59:00AM -0800, Ian Ward Comfort wrote: >=20 > > By historical accident, diffs included in commit templates and stat= us > > output when the "-v" option is given are not prefixed with the # co= mment > > character, as other advice and status information is. Stripping the= se > > lines is thus a best-effort operation, as it is not always possible= to > > tell which lines were generated by "-v" and which were inserted by = the > > user. > >=20 > > Improve this situation by adding the # prefix to diff output along = with > > all other status output in these cases. The change is simply made t= hanks > > to a3c158d (Add a prefix output callback to diff output, 2010-05-26= ). The > > prefixed diff can be stripped (or not, as configured) by the standa= rd > > cleanup code, so our special verbose-mode heuristic can be removed. > >=20 > > Documentation and a few tests which rely on the old "-v" format are > > updated to match. One known breakage is fixed in t7507. >=20 > One reason to keep the existing behavior is that editors will tend to > syntax-highlight the diff portion without much extra effort (in vim, = at > least, the syntax highlighting just includes the diff syntax > highlighting for that section). I have no idea if this would make thi= ngs > much harder for that case or not. >=20 > Even if it does make things harder there, I am not sure that the > increased robustness isn't more important, anyway. But I thought I wo= uld > point it out. We had robustness issues with 'git commit -v' in the past, and Junio's suggestion was to use "# Everything under this line is deleted." at the beginning of the commit message template, and do so after the editor exits. That would work with syntax highlighting (well, at least with vim), and perhaps isn't any less robust than prefixing the diff output with #. http://thread.gmane.org/gmane.comp.version-control.git/100525/focus=3D1= 00655 Best, G=E1bor