Skip to content

Instantly share code, notes, and snippets.

@jamesmunns
Created February 4, 2016 02:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jamesmunns/706a569de948c6801a37 to your computer and use it in GitHub Desktop.
Save jamesmunns/706a569de948c6801a37 to your computer and use it in GitHub Desktop.
# COMPARE A REFERENCE AGAINST WORKING DIRECTORY
# Use (from the git repo root):
# <path to script>/diffref.sh master
# Build destination temp folder
DATEHASH=`echo "obase=16; $(date +%s)" | bc`
DESTFOLDER=/tmp/diffref-$DATEHASH-$1
mkdir $DESTFOLDER
# Export Reference
git archive $1 | tar -xC $DESTFOLDER
# Fire Diff
bcomp -ro1 $DESTFOLDER $(pwd) -title1=$1 -title2="Working Directory"
# Clean Up
rm -rf $DESTFOLDER
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment