Created
October 25, 2018 19:59
-
-
Save MahmoudDolah/da93e7e600a09f9169e9b0e5f9903ddd to your computer and use it in GitHub Desktop.
Bash script that will find copyright updates in upgrades and add them to be a single commit
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 | |
CHANGED="`git diff --name-only`" | |
for f in $CHANGED; do | |
echo -n "$f... " | |
DIFF="`git diff -U0 $f | grep -E '^[+-]' | grep -v -E '^(---|\+\+\+) [ab]/' | grep -v -e '* @copyright Copyright (c)' -e '* @copyright Copyright (c)'`" | |
if [ "$DIFF" == "" ]; then | |
git add "$f" | |
echo "copyright." | |
else | |
echo "other." | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment