Fix GLPK linking (#7357)
[cvc5.git] / contrib / get-authors
index d2bd1e7f5ba2c00c829709da7f9fb3e32233be40..3bec5513028419e23065c90298f45482e4d72186 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 #
 # get-authors
-# Copyright (c) 2009-2019  The CVC4 Project
+# Copyright (c) 2009-2021  The cvc5 Project
 #
 # usage: get-authors [ files... ]
 #
@@ -13,12 +13,15 @@ gituser="`git config user.name` <`git config user.email`>"
 while [ $# -gt 0 ]; do
   f=$1
   shift
-  if ! grep -q " \*\* Top contributors" "$f"
+  if ! grep -q " Top contributors" "$f"
   then
     header_lines=0
   else
-    header_lines=$(grep "\*\*\/" "$f" -m 1 -n | cut -d ':' -f 1)
-    if [ -z $header_lines ]; then header_lines=0; fi
+    header_lines=$(grep "^ \*\/" "$f" -m 1 -n | cut -d ':' -f 1)
+    if [ -z $header_lines ]; then
+      header_lines=$(grep "^##$" "$f" -m 3 -n | tail -n 1 | cut -d ':' -f 1)
+      [ -z "$header_lines" ] && header_lines=0;
+    fi
   fi
   ((header_lines++))
   total_lines=$(wc -l "$f" | awk '{print$1}')
@@ -41,15 +44,14 @@ while [ $# -gt 0 ]; do
     # (1) #include
     # (2) namespace
     # (3) } ... namespace ...
+    # (4) empty lines
     #
     awk -F ')' \
-      '$2 !~ /^[ \t]*(#include|namespace|}.*namespace.*)/ {print $1}' | \
+      '$2 !~ /^[ \t]*(#include|namespace|}.*namespace.*|[ \t]*$)/ {print $1}' | \
 
     # Keep author names only, remove the last 4 columns in ( ... )
-    awk 'NF{NF-=4};1' | \
 
-    # Determine top three contributors
-    sort | uniq -c | sort -rn | head -n3 | \
+    awk 'NF{NF-=4};1' | \
 
     # Fix author names
     sed "s,Not Committed Yet <not.committed.yet>,$gituser," | \
@@ -63,8 +65,16 @@ while [ $# -gt 0 ]; do
     sed 's/makaimann/Makai Mann/' | \
     sed 's/Martin Brain/Martin/' | \
     sed 's/Martin/Martin Brain/' | \
+    sed 's/nafur/Gereon Kremer/' | \
     sed 's/justinxu421/Justin Xu/' | \
     sed 's/yoni206/Yoni Zohar/' | \
+    sed 's/ayveejay/Andrew V. Jones/' | \
+    sed 's/FabianWolff/Fabian Wolff/' | \
+    sed 's/mudathirmahgoub/Mudathir Mohamed/' | \
+    sed 's/mcjuneho/Michael Chang/' | \
+
+    # Determine top three contributors
+    sort | uniq -c | sort -rn | head -n3 | \
 
     # Remove first columns from uniq -c (number of lines)
     awk '{$1=""; print}' | \