Skip to content

@bhattisatish /track_spree
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
TRACKS CHANGES TO PARTS OF SPREE SINCE A GIVEN COMMIT
#!/usr/bin/env zsh
# 1304046900 TRACKS CHANGES TO PARTS OF SPREE SINCE A GIVEN COMMIT
# To be placed at the root of your app.
old_commit="29e3d4f707bdb047a6fabc2543247139027b06fb"
parts=(
core/app/views
core/config/locales/en.yml
core/lib/generators/spree/install/templates
)
# Exit on failure
#
set -e
git clone git://github.com/spree/spree.git tmp/spree_check
cd tmp/spree_check
if output=$(git diff --exit-code --name-status "$old_commit" HEAD -- "${parts[@]}"); then
echo "No changes"
else
# Group name statuses
#
while read -r line; do
case $line in
(M*) modified+=("$line") ;;
(A*) added+=("$line") ;;
(D*) deleted+=("$line") ;;
esac
done <<< "$output"
# Display groups
#
if [[ -n $modified ]]; then
print -l -- "${modified[@]}"
echo
fi
if [[ -n $added ]]; then
print -l -- "${added[@]}"
echo
fi
if [[ -n $deleted ]]; then
print -l -- "${deleted[@]}"
echo
fi
echo "You are now at: $(git rev-parse HEAD)"
fi
cd ../../
rm -r tmp/spree_check
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.