I ran into the same problem too. The output of "git rev-parse" just happens to contain a newline. So I happened to look at the manual page of rev-parse and saw this option:

--sq
    Usually the output is made one line per flag and parameter. This option makes output a single
    line, properly quoted for consumption by shell. Useful when you expect your parameter to contain
    whitespaces and newlines (e.g. when using pickaxe -S with git diff-*). In contrast to the
    --sq-quote option, the command input is still interpreted as usual.

Here is an example when run on a windows box:

git rev-parse --sq 64b62d8698dddafb06362a92d3fcaf7a36b91835
'64b62d8698dddafb06362a92d3fcaf7a36b91835'

Maybe this could help resolve the ambiguity of what belongs to the result and what not (some github pull requests mention getting rid of error output mixed together with the actual output).

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to