]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Ignore copyright update commits when determining the last update to a file. 437/head
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 14 Jan 2015 16:27:29 +0000 (10:27 -0600)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Thu, 15 Jan 2015 02:36:11 +0000 (20:36 -0600)
contrib/utilities/update-copyright

index 2a9b62980863b961c9ed93057a765213cc3b2c94..4bd42c34c0462fc7edaad7f09e1d6fe2863045bb 100755 (executable)
@@ -35,8 +35,21 @@ files="`echo include/deal.II/*/*h \
        "
 
 for i in $files ; do
-  # get the last year this file was modified from the git log
-  last_year=`git log -n 1 --date=short --format="format:%cd" $i | perl -pi -e 's/.*(\d\d\d\d)-.*/\1/g;'`
+  # get the last year this file was modified from the git log.
+  # we don't want to see patches that just updated the copyright
+  # year, so output the dates and log messages of the last 3
+  # commits, throw away all that mention both the words
+  # "update" and "copyright", and take the year of the first
+  # message that remains
+  #
+  # (it should be enough to look at the last 2 messages since
+  # ideally no two successive commits should have updated the
+  # copyright year. let's err on the safe side and take the last
+  # 3 commits.)
+  last_year=`git log -n 3 --date=short --format="format:%cd %s" $i | \
+             egrep -i -v "update.*copyright|copyright.*update" | \
+             head -n 1 | \
+             perl -pi -e 's/^(\d\d\d\d)-.*/\1/g;'`
 
   # get the first year this file was modified from the actual
   # file. this may predate the git log if the file was copied

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.