From c0b0632a83ca1e997b9002bf9e67b0dbbbd154b1 Mon Sep 17 00:00:00 2001 From: Morgan Deters Date: Thu, 5 Dec 2013 14:40:18 -0500 Subject: [PATCH] Script fixes; when determining authorship of source files, don't count copyright-updating commits. --- contrib/get-authors | 2 +- contrib/update-copyright.pl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/get-authors b/contrib/get-authors index 0fe71dca3..508408006 100755 --- a/contrib/get-authors +++ b/contrib/get-authors @@ -26,7 +26,7 @@ while [ $# -gt 0 ]; do minor_contributors= total_lines=`wc -l "$f" | awk '{print$1}'` original_author=`git log --use-mailmap --pretty="format:%aN <%aE>" "$f" | tail -1` - git blame --incremental "$f" | gawk '/^[0-9a-f]+ [0-9]+ [0-9]+ [0-9]+$/ {nl=$4;} /^author / {$1=""; author=$0;} /^author-mail / {mail=$2} /^filename / {while(nl--) {print author,mail}}' | sed "s,Not Committed Yet ,$gituser," | sort | uniq -c | sort -n | + git blame --incremental "$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," | sort | uniq -c | sort -n | ( while read lines author; do pct=$((100*$lines/$total_lines)) if [ "$author" != "$original_author" ]; then diff --git a/contrib/update-copyright.pl b/contrib/update-copyright.pl index f7ce15f6c..720e69d16 100755 --- a/contrib/update-copyright.pl +++ b/contrib/update-copyright.pl @@ -63,7 +63,7 @@ use Fcntl ':mode'; my $dir = $0; $dir =~ s,/[^/]+/*$,,; -if($#ARGV >= 0 && $ARGV[0] eq '-h' || $ARGV[0] eq '--help') { +if($#ARGV >= 0 && ($ARGV[0] eq '-h' || $ARGV[0] eq '--help')) { open(my $SELF, $0) || die "error opening $0 for reading"; while($_ = <$SELF>) { last if !/^#/; -- 2.30.2