4 # Copyright (c) 2009-2018 The CVC4 Project
6 # usage: get-authors [ files... ]
8 # This script uses git to get the original author
11 gituser
="`git config user.name` <`git config user.email`>"
13 if [ "$1" = "--email" ]; then
17 strip_email
="sed 's, *<[^>]*@[^>]*>,,g'"
20 while [ $# -gt 0 ]; do
24 if [ -z "`grep " \
*\
* Top contributors
" $f`" ]
28 header_lines
=`grep "\*\*\/" $f -m 1 -n | cut -d ':' -f 1`
29 if [ -z $header_lines ]; then header_lines
=0; fi
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"