-echo -e $EXCLUDE > $EXCFILE
-
-git ls-files $DIRS | grep -v ${0##*/} | while read FILE; do
- if [ "$FILE" == 'contrib/scripts/updatecw.sh' ]; then
- echo $FILE": *** EDIT MANUALLY ***"
- continue
- fi
-
- NEEDCOPY=false
- # Pick only files that have changed since START
- # %ai author dates holds has bad data: April 2013
- git log --follow --since=$START --pretty=format:"%ae %ci %H" $FILE |\
- grep -v -f $EXCFILE |\
- awk "/$AUTH_WHAM|$AUTH_INT/ {print substr(\$2,1,4)}"> $TMPFILE
+#Commits to exclude (whitespace, copyright, prefix, revert, delete only, etc)
+cat << EXCLUDE_END > $EXCFILE
+003df3c38fe74a092f75569793edd6ec5a387d5c
+01def2b635ff0b7bacde158d9124334c42cd5d2b
+08aa217ce49aba1ded52e0f7adb8a607035123fd
+11db1a551172f596d1d284e8496530f9ce24ac81
+14d162c5438de959d0ea01fb1b40a7c5dfa764d1
+1f1d3a376d488d715dd1b0c94d5b66ea05c1e6ca
+27bc60aa7cb3c567fd3150cc55a133d60cec2405
+2841be335687840cf98961e6c6cde6ee9312e4d7
+317ebf88af58e9d9235c90f84b112e931ae69b43
+320e014a2c93cb905637d178269b80847cb8d277
+3f90f344ae059b30e7d23e4fe554a985eb827b02
+4df63615669a69b51c752cc4e416f705f8a56197
+5d37670e8507563db556879041c7992936aefa56
+60e07b972114df24105a3a1bfa7365892f72a4a7
+65701b4a30efdb695776bcf690a2b3cabc928da1
+98060d83459ba10409f295898f0ec917f938b4d3
+b1e595c09e1b07a6840142b3ae015b8a5a8affeb
+b529a917a48cb0873f2898348b25a1074d7e9429
+b5a7260ae8f96c3ff9a9948dacc4f17a46943d00
+c2c14f31da5f69770d3a46627c81335f5b8d7821
+cd8c65642f1c36b56ae74a0414a1f1f27337a662
+e3a7c58aebafce40323db54bf6056029e5af4a70
+e5f552b70dccbd2fdf21ec7b7053a01bcbe062c2
+e64d9101cc8ebc61924d6e9db6d7ab3cfa94767c
+f2a9374170e4522b9d2ac3b7096cf2912339d480
+fc1475ebdd64cd8eccc603d629ac6b4dcd222445
+EXCLUDE_END
+[ -n "$EXCLUDE" ] && echo "$EXCLUDE" >> $EXCFILE
+
+HASHFILE=$TMP/hash_list
+> $TMP/hash_list
+git ls-files $DIRS | while read FILE; do
+ FILE=$FILE # just so FILE shows up in "sh -vx" output
+ case "$FILE" in
+ */list.h)
+ # file is copied from upstream kernel
+ continue ;;
+ */liblustreapi.h)
+ # file just includes lustreapi.h, copyrights are in there
+ continue ;;
+ */*.patch|*/*.series)
+ # patches can't add copyrights easily
+ continue ;;
+ */lustre_dlm_flags.h)
+ # file is automatically generated
+ continue ;;
+ */.gitignore)
+ continue ;;
+ esac
+
+ OLDCOPY=$(egrep "$INTCOPY" $FILE | tail -n1)
+ # Skip files that already have a copyright for this year
+ [ -n "$(egrep -e $THISYEAR <<<"$OLDCOPY")" ] && continue
+
+ ADDCOPY=false
+ # Pick only files that have changed since $START
+ # %ai author dates holds has bad data, use %ci instead
+ # Exclude revert commits and the patch being reverted.
+ git log --follow --since=$START --pretty=format:"%ci %ae %H" $FILE |
+ grep -v -f $EXCFILE | egrep -e "$AUTH_INT|$AUTH_WHAM" |
+ while read YYYY TTTT TZZZ AUTHOR HASH; do
+ REVERT=$(git show -s $HASH |
+ awk '/This reverts commit/ { print $4 }')
+ if [ -n "$REVERT" ]; then
+ echo $HASH >> $EXCFILE
+ tr -d . <<<$REVERT >> $EXCFILE
+ continue
+ fi
+ echo "$YYYY $TTTT $TZZZ $AUTHOR $HASH"
+ done > $TMPFILE.2
+ grep -v -f $EXCFILE $TMPFILE.2 > $TMPFILE