Created
December 3, 2013 14:30
-
-
Save prophile/7770070 to your computer and use it in GitHub Desktop.
A script for testing content differences on whitespace changes in srweb
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 | |
| # Usage: review-ws (gerrit change number) when in an srweb clone | |
| SSH_HOST=badger | |
| set -e | |
| REF=$(ssh $SSH_HOST gerrit query --current-patch-set $1 | grep '^ ref: ' | cut -d' ' -f6) | |
| git fetch https://www.studentrobotics.org/gerrit/srweb $REF | |
| git checkout FETCH_HEAD | |
| FILES=$(git diff --name-only HEAD~1 HEAD | grep '^content/en') | |
| for FILE in $FILES | |
| do | |
| git show HEAD:$FILE | sed '1,5d' | pandoc -f markdown_phpextra -t markdown > /tmp/review-latest.md | |
| git show HEAD~1:$FILE | sed '1,5d' | pandoc -f markdown_phpextra -t markdown > /tmp/review-prev.md | |
| if ! diff /tmp/review-prev.md /tmp/review-latest.md >/dev/null ; then | |
| echo -en "\033[47;31m" # Red | |
| echo "$FILE differs in content." | |
| tput sgr0 | |
| else | |
| echo -en "\033[47;32m" # Green | |
| echo "$FILE has no content differences." | |
| tput sgr0 | |
| fi | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
does that parse the markdown, and then output markdown!?