From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Kastrup Subject: Re: Fwd: [Bug] - Processing commit message after amend Date: Fri, 16 May 2014 12:34:15 +0200 Message-ID: <87mweif1w8.fsf@fencepost.gnu.org> References: Mime-Version: 1.0 Content-Type: text/plain Cc: git@vger.kernel.org To: Michal Stasa X-From: git-owner@vger.kernel.org Fri May 16 12:34:31 2014 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 1WlFTD-0005dt-BD for gcvg-git-2@plane.gmane.org; Fri, 16 May 2014 12:34:31 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757088AbaEPKe2 (ORCPT ); Fri, 16 May 2014 06:34:28 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:40880 "EHLO fencepost.gnu.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757081AbaEPKe1 (ORCPT ); Fri, 16 May 2014 06:34:27 -0400 Received: from localhost ([127.0.0.1]:39921 helo=lola) by fencepost.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WlFT7-0000gg-UI; Fri, 16 May 2014 06:34:26 -0400 Received: by lola (Postfix, from userid 1000) id B5A15E0BD9; Fri, 16 May 2014 12:34:15 +0200 (CEST) In-Reply-To: (Michal Stasa's message of "Fri, 16 May 2014 12:18:07 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: Michal Stasa writes: > I have stumbled on a weird bug. At work, we use redmine as an issue > tracker and its task are marked by a number starting with #. When I > commit some work and write #1234 in the message, it works. However, > later on when I remember that I forgot to add some files and amend the > commit, vim appears and I cannot perform the commit because the > message starts with # which is a comment in vim and thus I get an > error that my commit message is empty. > > Steps to reproduce: > 1) commit a file > git commit File1.txt -m "#1234 documentation added" > > 2) amend previous commit > git commit File2.txt -- amend > > 3) go for :wq right away git commit --amend -C HEAD File2.txt should do the trick without starting the editor. > However, if you use amend and no edit option, it works > git commit --amend --no-edit Ah, so you got your solution. It's not like you could add that sort of commit message interactively to start with, so it's not all that surprising that you won't be able to amend it interactively. -- David Kastrup