Last active
September 4, 2018 13:44
-
-
Save nbibler/a72ed924382ee193bf63dc33823e006b to your computer and use it in GitHub Desktop.
Query a server's Rapporteur (or other) revision and compare it to the local git revision
This file contains hidden or 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 | |
set -e | |
status_url=$1 | |
local_revision=$(git rev-parse HEAD) | |
printf "%40s %-20s\n" $local_revision "Local" | |
remote_revision=$(curl --compressed --get --silent "$status_url" | jq --compact-output --monochrome-output '.revision' | tr -d '"') | |
printf "%40s %-20s\n" $remote_revision "Remote" | |
if [ "$remote_revision" == "$local_revision" ] | |
then | |
echo "Versions are identical. No difference." | |
else | |
git l $remote_revision...$local_revision | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Called with:
diff-to-release.sh "https://my.server.url/status.json"