+DIRS=${DIRS:-"build ldiskfs libcfs lnet lustre snmp lustre-iokit"}
+#Commits to exclude
+EXCLUDE=${EXCLUDE:-'e3a7c58aebafce40323db54bf6056029e5af4a70\n
+65701b4a30efdb695776bcf690a2b3cabc928da1\n
+f2a9374170e4522b9d2ac3b7096cf2912339d480\n
+3f90f344ae059b30e7d23e4fe554a985eb827b02\n
+320e014a2c93cb905637d178269b80847cb8d277\n
+cd8c65642f1c36b56ae74a0414a1f1f27337a662'}
+
+XYRACOPY="Copyright.*Xyratex Technology Limited"
+ORACOPY1="Copyright.*Oracle.*"
+ORACOPY2="Use is subject to license terms."
+#Copyright we rewrite to the current version
+WHAMCOPY=${WHAMCOPY:-"Copyright.*Whamcloud,* Inc."}
+INTREPCOPY=${INTREPCOPY:-"Copyright.*Intel, Inc."}
+INTREPCOPY2=${INTREPCOPY2:-"Copyright.*Intel Corporation$"}
+#The current copyright
+INTCOPY=${INTCOPY:-"Copyright.*Intel Corporation."}
+
+#Emails we assume ownership of
+AUTH_WHAM=${AUTH_WHAM:-".*@whamcloud.com"}
+AUTH_INT=${AUTH_INT:-".*@intel.com"}
+
+#Post Oracle date
+START=${START:-"2010-06-01"}
+ECHOE=${ECHOE:-"echo -e"}
+[ "$($ECHOE foo)" = "-e foo" ] && ECHOE=echo
+
+echo -e $EXCLUDE > $EXCFILE
+
+git ls-files $DIRS | grep -v ${0##*/} | while read FILE; do
+#FILE=lustre/mdt/mdt_hsm.c
+#FILE=lustre/include/lustre_quota.h
+ if [ "$FILE" == 'build/updatecw.sh' ]; then
+ echo $FILE": *** EDIT MANUALLY ***"
+ continue
+ fi
+
+ NEEDCOPY=false
+ # Pick only files that have changed since START
+ git log --follow --since=$START --author=$AUTH_WHAM --author=$AUTH_INT\
+ --pretty=format:"%ai %H" $FILE | grep -v -f $EXCFILE |
+ cut -d- -f1 > $TMPFILE
+ # Skip files not modified by $AUTHOR
+ [ -s "$TMPFILE" ] || continue
+
+ OLDCOPY="$(egrep -e "$XYRACOPY|$ORACOPY1|$ORACOPY2|$WHAMCOPY|$INTCOPY"\
+ -e "$INTREPCOPY|$INTREPCOPY2" $FILE|tail -n1 | tr / .)"