From: Michael Ellerman Date: Fri, 19 Jun 2015 05:50:41 +0000 (+1000) Subject: merge_msg: Change it to take the conflicting commits and files X-Git-Url: https://git.ozlabs.org/?a=commitdiff_plain;h=d4e40036528a66aa9d82c9ec1045f125c1cb122a;p=next-scripts merge_msg: Change it to take the conflicting commits and files --- diff --git a/merge_msg b/merge_msg index dbee7cc..8c31431 100755 --- a/merge_msg +++ b/merge_msg @@ -6,10 +6,18 @@ branch="" shift 2 } -file="$*" +commit1=$1 +shift + +commit2=$1 +shift -gitk --merge -- $file & -[ "$file" ] && gvim $file 2>/dev/null +if [[ -z $commit1 || -z $commit2 ]]; then + echo "Usage: $0 [-t branch] commit1 commit2 [files...]" >&2 + exit 1 +fi + +file="$*" conf="a conflict" [ "$#" -gt 1 ] && { @@ -20,11 +28,47 @@ conf="a conflict" subject="manual merge of the BRANCH tree with the FIXME tree" +c1_title=$(git log -1 --pretty="%h \"%s\"" $commit1) +c2_title=$(git log -1 --pretty="%h \"%s\"" $commit2) +c1_addrs=$(git log -1 --pretty="%an <%ae>, %cn <%ce>" $commit1) +c2_addrs=$(git log -1 --pretty="%an <%ae>, %cn <%ce>" $commit2) +c1_sobs=$(git log -1 --pretty="%b" $commit1 | awk '$1 ~ /-by:/ {$1=""; print $0","}') +c2_sobs=$(git log -1 --pretty="%b" $commit2 | awk '$1 ~ /-by:/ {$1=""; print $0","}') + +diff=$(git diff $file) + $(dirname $0)/message_helper $branch "$subject" <