From mboxrd@z Thu Jan 1 00:00:00 1970 From: Junio C Hamano Subject: Re: git commit -v does not removes the patch Date: Tue, 11 Nov 2008 09:13:18 -0800 Message-ID: <7v4p2e2nkg.fsf@gitster.siamese.dyndns.org> References: <20081110181023.GA22753@coredump.intra.peff.net> <7vej1j40x5.fsf@gitster.siamese.dyndns.org> <20081111000706.GA26223@coredump.intra.peff.net> <20081111102914.GA30330@coredump.intra.peff.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Santi =?utf-8?Q?B=C3=A9jar?= , Git Mailing List To: Jeff King X-From: git-owner@vger.kernel.org Tue Nov 11 18:15:43 2008 Return-path: Envelope-to: gcvg-git-2@gmane.org Received: from vger.kernel.org ([209.132.176.167]) by lo.gmane.org with esmtp (Exim 4.50) id 1Kzwpu-0005XD-Hq for gcvg-git-2@gmane.org; Tue, 11 Nov 2008 18:15:31 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752857AbYKKROO (ORCPT ); Tue, 11 Nov 2008 12:14:14 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752753AbYKKROO (ORCPT ); Tue, 11 Nov 2008 12:14:14 -0500 Received: from a-sasl-fastnet.sasl.smtp.pobox.com ([207.106.133.19]:64878 "EHLO sasl.smtp.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752446AbYKKRON (ORCPT ); Tue, 11 Nov 2008 12:14:13 -0500 Received: from localhost.localdomain (unknown [127.0.0.1]) by a-sasl-fastnet.sasl.smtp.pobox.com (Postfix) with ESMTP id 2D59F7B529; Tue, 11 Nov 2008 12:14:10 -0500 (EST) Received: from pobox.com (unknown [68.225.240.211]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-sasl-fastnet.sasl.smtp.pobox.com (Postfix) with ESMTPSA id 016A57B528; Tue, 11 Nov 2008 12:13:58 -0500 (EST) In-Reply-To: <20081111102914.GA30330@coredump.intra.peff.net> (Jeff King's message of "Tue, 11 Nov 2008 05:29:15 -0500") User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) X-Pobox-Relay-ID: 27A1647A-B014-11DD-B8FF-9CEDC82D7133-77302942!a-sasl-fastnet.pobox.com Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: Jeff King writes: > But I have to wonder if there is some more robust solution. It seems > like this can have false positives if you include diff output in your > commit message, and a potential false negative if you delete the newline > (e.g., delete everything up to "diff --git", making it the first line). Actually, I recall (from my googling quite some time ago) people noticing this, but they learnt to live with it. We may want to change this. We can say "# Everything under this line is deleted." at the beginning of the "#" block we produce in the commit log message editor, replacing the "Lines starting with '#' will be ignored, " we currently have. When reading back the editor result, make "git commit -v" scan for the "# Everything ..." line. We remove it and everything that follows, but we do not touch anything above that line (including the ones that begin with "diff" or "#") except the usual trailing whitespace removal. That way, people can leave a sample shell session with root prompt, and sample diff, in their message. If we do not see "# Everything ..." when we read it back, we can do what we currently do as a fallback.