Last active
August 29, 2015 14:11
-
-
Save rickychien/5fb0f4aa6e6eace5222b to your computer and use it in GitHub Desktop.
Compare difference between two commits (HEAD and HEAD^) for gaia profile (Usage: ./diff-build.sh)
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
#!/bin/bash | |
REV1=HEAD | |
REV2=HEAD^ | |
if [ -z "$REV1" -o -z "$REV2" ]; then | |
echo "Usage: $0 REV1 REV2"; | |
exit 1; | |
fi | |
compute_profile () { | |
REV=$1 | |
if [ ! -d diffs/profiles/$REV ]; then | |
git checkout $REV | |
make clean | |
make | |
mv profile diffs/profiles/$REV | |
fi | |
} | |
unzip_profile () { | |
REV=$1 | |
if [ ! -d diffs/unzip/$REV ]; then | |
mkdir -p diffs/unzip/$REV | |
cp -r diffs/profiles/$REV/* diffs/unzip/$REV/ | |
ZIPS=$(find diffs/unzip/$REV/ -name *.zip) | |
for ZIP in $ZIPS; do | |
unzip -q -d $(echo $ZIP | sed 's/\.zip$/\.unzip/') $ZIP | |
rm $ZIP | |
done; | |
fi | |
} | |
cd gaia | |
mkdir -p diffs/profiles | |
compute_profile $REV1 | |
compute_profile $REV2 | |
mkdir -p diffs/unzip | |
unzip_profile $REV1 | |
unzip_profile $REV2 | |
cd diffs/unzip && diff --brief -r $REV1 $REV2 | |
echo "" | |
echo "For more details, run:" | |
echo " diff -r diffs/unzip/$REV1 diffs/unzip/$REV2" | |
echo " or same with meld, kdiff3,..." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment