From 74b11e0bd7282014d8a8893d7abc25eb24731d79 Mon Sep 17 00:00:00 2001 From: Aina Niemetz Date: Tue, 13 Feb 2018 11:04:27 -0800 Subject: Skip header for determining top contributors list. (#1603) --- contrib/get-authors | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'contrib/get-authors') diff --git a/contrib/get-authors b/contrib/get-authors index 34ebdf5e3..c0f49fac9 100755 --- a/contrib/get-authors +++ b/contrib/get-authors @@ -22,8 +22,16 @@ while [ $# -gt 0 ]; do f=$1 shift contributors= + if [ -z "`grep " \*\* 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 + fi + ((header_lines++)) total_lines=`wc -l "$f" | awk '{print$1}'` - git blame --incremental "$f" | \ + git blame --incremental -L $header_lines,$total_lines "$f" | \ 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}}' | \ sed "s,Not Committed Yet ,$gituser," | \ sed 's/PaulMeng/Paul Meng/' | \ -- cgit v1.2.3