Michal Stasa <michal.st...@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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to