1 $ cat ~/bin/git-revert-merge
2 if [ $# -ne 2 ]; then
3 echo "error: revert-merge needs exactly two arguments, the <commit>-ish to revert and the <commit>-ish of the mainline parent" >&2
4 exit 1
5 fi
6 git rev-parse "$2" >/dev/null &&
7 git revert "$1" -m "$(git rev-list --parents -n 1 "$1" | sed -e "s/ $(git rev-parse "$2").*//" -e '\''s/[^ ]\+ \?/X/g'\'' | wc -c)"
8 $ i