Created
October 14, 2014 11:40
-
-
Save unakatsuo/777a0fcc8ac4c8dab8d1 to your computer and use it in GitHub Desktop.
Find modified files under the watching path between two git branches.
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 | |
set -ue | |
WATCH_PATH="config/db/migrations/" | |
MASTER_BRANCH="$1" | |
WORK_BRANCH="$2" | |
join -1 4 -2 4 -a 2 <(git ls-tree $MASTER_BRANCH -- $WATCH_PATH) <(git ls-tree $WORK_BRANCH -- $WATCH_PATH) | \ | |
awk '$4 != $7 {print $1 " is changed"; found++; } END{ if (found > 0){ exit 1; } }' | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment