Skip to content

Commit 6b94f1e

Browse files
author
Junio C Hamano
committed
merge: seed the commit message with list of conflicted files.
The files with conflicts need to be hand resolved, and it is a good discipline for the committer to explain which branch was taken and why. Pre-fill the merge message template with the list of conflicted paths to encourage it. This is from Linus. Signed-off-by: Junio C Hamano <[email protected]>
1 parent 767e130 commit 6b94f1e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

git-merge.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,5 +301,13 @@ then
301301
"Automatic merge went well; stopped before committing as requested"
302302
exit 0
303303
else
304+
{
305+
echo '
306+
Conflicts:
307+
'
308+
git ls-files --unmerged |
309+
sed -e 's/^[^ ]* / /' |
310+
uniq
311+
} >>"$GIT_DIR/MERGE_MSG"
304312
die "Automatic merge failed; fix up by hand"
305313
fi

0 commit comments

Comments
 (0)