Skip to content

Instantly share code, notes, and snippets.

@joar
Last active December 11, 2015 01:49
Show Gist options
  • Save joar/4526590 to your computer and use it in GitHub Desktop.
Save joar/4526590 to your computer and use it in GitHub Desktop.
#!/bin/zsh
#
# Outputs the diff between the git logs for two branches
#
### USAGE
# log-diff.sh branch1 branch2
#
# Written by Elvenlord Elrond from Samba-TNG <http://samba-tng.org> / GNU MediaGoblin <http://mediagoblin.org>
# No warranty what so ever.
#
# - 2013, colordiff and less `-R` flag added by Joar Wandborg <http://wandborg.se>
base="$(git merge-base "$1" "$2")^"
diff -c -C 4 -d -I'^commit' <(git whatchanged -p "${base}..$1") <(git whatchanged -p "${base}..$2") \
| colordiff \
| less -SR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment