-
Notifications
You must be signed in to change notification settings - Fork 3
/
gitstat.sh
executable file
·34 lines (29 loc) · 1.04 KB
/
gitstat.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
#!/bin/bash
# git fetch --all
# git pull --all
get_contributor() {
git log --format='%aN' \
| grep -v "root" \
| grep -v "abhishek_p_s" \
| grep -v "Deden Bangkit" \
| grep -v "nirav9spl" \
| grep -v "bhavin" \
| sort -u
}
contributors=$(get_contributor)
if [ $# -eq 1 ]; then
contributors=$(echo "${contributors}" | grep "$1")
fi
while read -r contributor; do
echo ""
echo "### Contributor: ${contributor}"
git log --author="${contributor}" --pretty=tformat: --numstat \
| grep -v "migrations" \
| grep -v "__snapshots__" \
| awk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf "Added Lines: %s, Removed Lines: %s, Total Lines: %s\n", add, subs, loc }' -
echo ""
git --no-pager log --reverse --author="${contributor}" --no-merges --pretty=format:"- [%Cblue%cd%Creset] %Cred%cn%Creset %s" --date=format:'%d %h %H:%M'
echo ""
echo ""
echo "----------------------------------------------------------------"
done < <(echo "${contributors}")