1 2 3 4 5 6 7 8 9 10 11
#!/bin/bash up="$1" shift [ $# -gt 0 ] \ && [ -n "${1%%--*}" ] \ && down="$1" \ && shift \ || down=HEAD git diff "$(git merge-base "$up" "$down")" "$down" "$@"