Created
February 4, 2016 02:12
-
-
Save jamesmunns/e5dc90d82b4800fa6e7e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# COMPARE TWO REFERENCES (Branch, Tag, Commit), both in Read-Only Mode | |
# Use (from the git repo root): | |
# <path to script>/diffref.sh master 123abcd | |
# Build destination folder | |
DATEHASH=`echo "obase=16; $(date +%s)" | bc` | |
DESTFOLDER1=/tmp/diffref-$DATEHASH-$1 | |
DESTFOLDER2=/tmp/diffref-$DATEHASH-$2 | |
mkdir $DESTFOLDER1 | |
mkdir $DESTFOLDER2 | |
# Export Reference | |
git archive $1 | tar -xC $DESTFOLDER1 | |
git archive $2 | tar -xC $DESTFOLDER2 | |
# Fire Diff | |
bcomp -ro1 -ro2 $DESTFOLDER1 $DESTFOLDER2 -title1=$1 -title2=$2 | |
# Clean Up | |
rm -rf $DESTFOLDER1 | |
rm -rf $DESTFOLDER2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment