summaryrefslogtreecommitdiff
path: root/contrib/get-authors
blob: ef6abff8efd3123e4a078d6a1edf344b71af20bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/sh
#
# get-authors
# Morgan Deters <mdeters@cs.nyu.edu> for CVC4
# Copyright (c) 2009, 2010, 2011  The CVC4 Project
#
# usage: get-authors [ files... ]
#
# This script uses svn to get the original author
#

while [ $# -gt 0 ]; do
  f=$1
  shift
  original_author=
  major_contributors=
  minor_contributors=
  total_lines=`wc -l "$f" | awk '{print$1}'`
  original_author=`svn log -q --incremental "$f" | tail -1 | awk '{print$3}'`
  svn blame "$f" | awk '{print$2}' | sort | uniq -c | sort -n |
    ( while read lines author; do
        pct=$((100*$lines/$total_lines))
        if [ "$author" != "$original_author" ]; then
          if [ $pct -ge 10 ]; then
            major_contributors="${major_contributors:+$major_contributors, }$author"
          else
            minor_contributors="${minor_contributors:+$minor_contributors, }$author"
          fi
        fi
      done; \
      echo "$original_author"
      echo "${major_contributors:-none}"
      echo "${minor_contributors:-none}" )
done
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback