#!/bin/bash
-log=../merge.log
-[ -f merge.log ] && log=merge.log
-control=../real_control
-[ -f real_control ] && control=real_control
+branch=()
+if [ "X$1" = 'X-b' ]; then
+ branch=( -b "$2" )
+ shift 2
+fi
-branch=$(grep '^Merging ' $log | tail -1 | sed 's/^Merging //')
-branch=${branch#quilt/}
-branch=${branch%%/*}
+gitk --merge -- "$@" &
-contact=$(sed -n "/ $branch /s/ .*$//p" $control)
-greeting=${contact%% *}
-[ "${contact%,*}" = "${contact}" ] || greeting="all"
+printf -v files ' %s\n' "$@"
+conf='a conflict'
+if [ "$#" -gt 1 ]; then
+ conf='conflicts'
+fi
-file="$*"
+subject='manual merge of the BRANCH tree with the FIXME tree'
-gitk.test --merge -- $file &
-[ "$file" ] && gvim $file
+"$(dirname "$0")/message_helper" "${branch[@]}" "$subject" <<EOF
+FIXME: Add owner of second tree to To:
+ Add author(s)/SOB of conflicting commits.
-sylpheed --compose "mailto:$contact?Cc=linux-next@vger.kernel.org,%20linux-kernel@vger.kernel.org&Subject=linux-next: manual merge of the $branch tree with the tree&Body=Hi $greeting,%0A\
-%0A\
-Today's linux-next merge of the $branch tree got a conflict in $file between commit (%22%22) from the tree and commit (%22%22) from the $branch tree."
+Today's linux-next merge of the BRANCH tree got $conf in:
+
+$files
+between commit:
+
+ ("")
+
+from the FIXME tree and commit:
+
+ ("")
+
+from the BRANCH tree.
+
+I fixed it up (see below) and can carry the fix as necessary. This
+is now fixed as far as linux-next is concerned, but any non trivial
+conflicts should be mentioned to your upstream maintainer when your tree
+is submitted for merging. You may also want to consider cooperating
+with the maintainer of the conflicting tree to minimise any particularly
+complex conflicts.
+EOF
exit 0