All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Kastrup <dak@gnu.org>
To: Michal Stasa <michal.stasa@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Fwd: [Bug] - Processing commit message after amend
Date: Fri, 16 May 2014 12:34:15 +0200	[thread overview]
Message-ID: <87mweif1w8.fsf@fencepost.gnu.org> (raw)
In-Reply-To: <CALy3b+m7YkYB+mPEnAQnjKFAwUS_PqCUFtuxzN7hwhmNfMrw3Q@mail.gmail.com> (Michal Stasa's message of "Fri, 16 May 2014 12:18:07 +0200")

Michal Stasa <michal.stasa@gmail.com> 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

      parent reply	other threads:[~2014-05-16 10:34 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-16 10:18 Fwd: [Bug] - Processing commit message after amend Michal Stasa
2014-05-16 10:28 ` Duy Nguyen
2014-05-16 10:34   ` Michal Stasa
2014-05-16 10:59   ` [PATCH] commit: switch core.commentChar if it's found in existing commit Nguyễn Thái Ngọc Duy
2014-05-16 13:51     ` [PATCH 1/2] config: be strict on core.commentChar Nguyễn Thái Ngọc Duy
2014-05-16 13:51       ` [PATCH 2/2] commit: allow core.commentChar=auto for character auto selection Nguyễn Thái Ngọc Duy
2014-05-16 16:40         ` Jonathan Nieder
2014-05-16 17:38           ` Junio C Hamano
2014-05-16 23:41           ` Duy Nguyen
2014-05-16 14:42       ` [PATCH 1/2] config: be strict on core.commentChar Felipe Contreras
2014-05-16 16:25       ` Jonathan Nieder
2014-05-16 17:36         ` Junio C Hamano
2014-05-17  1:52       ` [PATCH v2 " Nguyễn Thái Ngọc Duy
2014-05-17  1:52         ` [PATCH v2 2/2] commit: allow core.commentChar=auto for character auto selection Nguyễn Thái Ngọc Duy
2014-05-16 17:27     ` [PATCH] commit: switch core.commentChar if it's found in existing commit Junio C Hamano
2014-05-16 18:53       ` Junio C Hamano
2014-05-16 10:34 ` David Kastrup [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mweif1w8.fsf@fencepost.gnu.org \
    --to=dak@gnu.org \
    --cc=git@vger.kernel.org \
    --cc=michal.stasa@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.