Problem with multi-line commit messages

1,478 views
Skip to first unread message

Marke

unread,
May 2, 2012, 12:55:11 AM5/2/12
to msysGit
Hello, we're working with a tool that sends some git commands to the
shell, one of which attempts to amend a commit message with multiple
lines. On our windows machines, this command fails (only the first
line of the multi-line message gets set as the commit message). There
is no error, the rest of the message is simply omitted from what
msysgit reports as a successful amend. The format of the command sent
to the shell is as follows:

git commit --amend --message "First line

Next line...

etc."

(which results in the commit message being amended to "First line")

I wrote the command to a file and opened it in a binary editor and saw
that it is using strictly LF (0A). I tried replacing those with CRLF
(0D 0A) to no avail. If i open a msysgit shell and try to create a
multi-line message, it works fine (gives me a newline with > until i
close the quotes and then amends as expected).

Is there some formatting for newlines that git bash expects? Any
advice would be greatly appreciated.

Thanks,
-Marke

Johannes Sixt

unread,
May 2, 2012, 3:18:13 PM5/2/12
to Marke, msysGit
Am 02.05.2012 06:55, schrieb Marke:
> Hello, we're working with a tool that sends some git commands to the
> shell, one of which attempts to amend a commit message with multiple
> lines. On our windows machines, this command fails (only the first
> line of the multi-line message gets set as the commit message). There
> is no error, the rest of the message is simply omitted from what
> msysgit reports as a successful amend. The format of the command sent
> to the shell is as follows:
>
> git commit --amend --message "First line
>
> Next line...
>
> etc."
>
> (which results in the commit message being amended to "First line")

Do you have any shell meta characters in the commit message? Does the
script produce any errors? Can you post an example of a script?

-- Hannes
Reply all
Reply to author
Forward
0 new messages