forked from SahilBas2005/Bracket-Buddy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathParse Logs Script.sh
More file actions
27 lines (20 loc) · 878 Bytes
/
Parse Logs Script.sh
File metadata and controls
27 lines (20 loc) · 878 Bytes
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
# this shows total lines in Java files that were added/removed for each author
parse_plus_minus () {
printf "%-10s|%9d|" "$2" "$1"
printf "%13s|" `git log --numstat --pretty="%H" --author="$2" ./ | awk '/\.*\.java$/ {plus+=$1} END {printf("%d",plus)}'`
printf "%14s\n" `git log --numstat --pretty="%H" --author="$2" ./ | awk '/\.*\.java$/ {minus+=$2} END {printf("%d",minus)}'`
}
parse_repo_git_log () {
#cd $1
echo "=============================================="
echo "git log summary"
echo ""
echo "---------"
echo ""
echo "user name | commits | lines added | lines deleted"
echo "----------|--------:|------------:|-------------:"
#get number of commits per user (or do email?)
git log --format='%aN <%aE>' | awk '{arr[$0]++} END{for (i in arr){print arr[i], i;}}' | sort -rn | while read line ; do parse_plus_minus ${line} ; done
cd ".."
}
parse_repo_git_log