#!/bin/bash -e # Diff for a branch, starting from where it diverges from its upstream. BRANCH=HEAD if [ $# -gt 0 ]; then BRANCH="$1" shift fi exec git diff "${BRANCH}@{upstream}" "${BRANCH}" "$@"