-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathwwt.sh
executable file
·49 lines (44 loc) · 873 Bytes
/
wwt.sh
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/bash
DIR=$(dirname ${BASH_SOURCE[0]})
wwtarg=""
sortag="-nr"
headcmd="cat"
while :; do
case "$1" in
"--people"|"-p")
shift
;;
"--company"|"-C")
wwtarg="--company"
shift
;;
"--commits"|"-c")
sortag="-k4nr"
shift
;;
"--lines"|"-l")
shift
;;
"--top"|"-t")
shift
headcmd="head -n$1"
shift
;;
"--help"|"-h")
echo "Options:"
echo -e "\t-p|--people show people stats (defaul)"
echo -e "\t-C|--company show company stats"
echo -e "\t-l|--lines sort by lines (default)"
echo -e "\t-c|--commits sort by commits"
echo -e "\t-t|--top NUM show top NUM records"
exit 0
;;
*)
break
;;
esac
done
echo " Lines added Commits Who"
git log --pretty=short --shortstat -M --no-merges $@ | \
sh ${DIR}/criu-name-map | ${DIR}/wwt.py $wwtarg | \
sort $sortag | $headcmd | nl