Created
May 6, 2019 16:26
-
-
Save hatzopoulos/cadb1271c48ff387e9ede1810b18ea42 to your computer and use it in GitHub Desktop.
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
# add-whitespace-only.bash | |
for fname in $(git diff --name-only --diff-filter=ACMR --full-index HEAD) | |
do | |
diff=$(git diff -w --ignore-blank-lines --exit-code $fname) | |
if [ $? -eq 0 ]; then | |
echo "only whitespace diff on $fname ! adding to git..." | |
git add $fname | |
else | |
echo "diff on $fname!" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment