Two ways to fix this problem:
(I) prepare-commit-msg hook
Steps to use this hook:
Copy the existing sample:
cp .git/hooks/prepare-commit-msg.sample .git/hooks/prepare-commit-msg
Make sure the hook has the correct permissions:
chmod 755 .git/hooks/prepare-commit-msg
Here it is in case you don't have it in .git/hooks
:
#!/bin/sh
#
# An example hook script to prepare the commit log message.
# Called by "git commit" with the name of the file that has the
# commit message, followed by the description of the commit
# message's source. The hook's purpose is to edit the commit
# message file. If the hook fails with a non-zero status,
# the commit is aborted.
#
# To enable this hook, rename this file to "prepare-commit-msg".
# This hook includes three examples. The first comments out the
# "Conflicts:" part of a merge commit.
#
# The second includes the output of "git diff --name-status -r"
# into the message, just before the "git status" output. It is
# commented because it doesn't cope with --amend or with squashed
# commits.
#
# The third example adds a Signed-off-by line to the message, that can
# still be edited. This is rarely a good idea.
case "$2,$3" in
merge,)
/usr/bin/perl -i.bak -ne 's/^/# /, s/^# #/#/ if /^Conflicts/ .. /#/; print' "$1" ;;
# ,|template,)
# /usr/bin/perl -i.bak -pe '
# print "\n" . `git diff --cached --name-status -r`
# if /^#/ && $first++ == 0' "$1" ;;
*) ;;
esac
# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p')
# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1"
That following bit should comment out the Conflict section without you having to fiddle around with upgrading git itself.
case "$2,$3" in
merge,)
/usr/bin/perl -i.bak -ne 's/^/# /, s/^# #/#/ if /^Conflicts/ .. /#/; print' "$1" ;;
(II) Upgrade git to 2.1.3+
See commit 96f78d3
(Merged by Junio C Hamano -- gitster
-- on 28 Oct 2014)
Looking at the commit history:
49c3e92 (tag: refs/tags/v2.1.3) Git 2.1.3
ebc2e5a Merge branch 'jk/pack-objects-no-bitmap-when-splitting' into maint
9db1838 Merge branch 'da/mergetool-meld' into maint
af1b4e3 Merge branch 'rm/gitweb-start-form' into maint
27c31d2 Merge branch 'bc/asciidoc-pretty-formats-fix' into maint
a8f01f8 Merge branch 'rs/daemon-fixes' into maint
5b509df Update draft release notes to 2.2
9ce57f1 Merge branch 'da/difftool'
e82935d Merge branch 'rb/pack-window-memory-config-doc'
7654ca6 Merge branch 'mg/lib-gpg-ro-safety'
ce71c1f Merge branch 'dm/port2zos'
c1777a2 Merge branch 'oc/mergetools-beyondcompare'
d70e331 Merge branch 'jk/prune-mtime'
853878d Merge branch 'bc/asciidoctor'
96ef1bd api-run-command: add missing list item marker
8828f29 use child_process_init() to initialize struct child_process variables
5d222c0 receive-pack: avoid minor leak in case start_async() fails
261f315 merge & sequencer: turn "Conflicts:" hint into a comment
that change should be a part of Git from v. 2.1.3 onwards. So if you upgrade to git version 2.1.3+ the 'Conflict' should be automatically commented out making the 'Change-Id' the last line in the commit message thus solving your problem.