Skip header for determining top contributors list. (#1603)
authorAina Niemetz <aina.niemetz@gmail.com>
Tue, 13 Feb 2018 19:04:27 +0000 (11:04 -0800)
committerGitHub <noreply@github.com>
Tue, 13 Feb 2018 19:04:27 +0000 (11:04 -0800)
contrib/get-authors

index 34ebdf5e3e3d3a79285ce87df271b1d71066a2ba..c0f49fac9f7b00cacfb2999adb71b72106bb6ed9 100755 (executable)
@@ -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 <not.committed.yet>,$gituser," | \
     sed 's/PaulMeng/Paul Meng/' | \