Remove references to nyu (#1721)
[cvc5.git] / contrib / get-authors
1 #!/bin/sh
2 #
3 # get-authors
4 # Copyright (c) 2009-2018 The CVC4 Project
5 #
6 # usage: get-authors [ files... ]
7 #
8 # This script uses git to get the original author
9 #
10
11 gituser="`git config user.name` <`git config user.email`>"
12
13 if [ "$1" = "--email" ]; then
14 strip_email=cat
15 shift
16 else
17 strip_email="sed 's, *<[^>]*@[^>]*>,,g'"
18 fi
19
20 while [ $# -gt 0 ]; do
21 f=$1
22 shift
23 contributors=
24 if [ -z "`grep " \*\* Top contributors" $f`" ]
25 then
26 header_lines=0
27 else
28 header_lines=`grep "\*\*\/" $f -m 1 -n | cut -d ':' -f 1`
29 if [ -z $header_lines ]; then header_lines=0; fi
30 fi
31 ((header_lines++))
32 total_lines=`wc -l "$f" | awk '{print$1}'`
33 git blame -w -M -C --incremental -L $header_lines,$total_lines "$f" | \
34 gawk '/^[0-9a-f]+ [0-9]+ [0-9]+ [0-9]+$/ {nl=$4;} /^summary .*copyright/ {nl=0} /^author / {$1=""; author=$0;} /^author-mail / {mail=$2} /^filename / {while(nl--) {print author,mail}}' | \
35 sed "s,Not Committed Yet <not.committed.yet>,$gituser," | \
36 sed 's/PaulMeng/Paul Meng/' | \
37 sed 's/barrettcw/Clark Barrett/' | \
38 sed 's/Andres Nötzli/Andres Noetzli/' | \
39 sed 's/Andres Notzli/Andres Noetzli/' | \
40 sed 's/guykatzz/Guy/' | \
41 sed 's/Guy Katz/Guy/' | \
42 sed 's/Guy/Guy Katz/' | \
43 eval "$strip_email" | \
44 sort | uniq -c | sort -nr | head -n 3 | \
45 ( while read lines author; do
46 contributors="${contributors:+$contributors, }$author"
47 done; \
48 echo "$contributors")
49 done