added personal line counting util
This commit is contained in:
parent
11c0d7b489
commit
fe5200c838
2 changed files with 70 additions and 0 deletions
28
countlines.sh
Normal file
28
countlines.sh
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
#!/bin/bash
|
||||
|
||||
AUTHOR=$(git config user.email)
|
||||
echo -e "Checking commit stats for \033[38:5:2m$AUTHOR\033[0m..."
|
||||
|
||||
# Get numstat for commits by author, filter only .java lines
|
||||
git log --author="$AUTHOR" --since="7 days ago" --pretty=tformat: --numstat \
|
||||
| awk '
|
||||
$3 ~ /\.java$/ {
|
||||
added += $1
|
||||
removed += $2
|
||||
}
|
||||
END {
|
||||
print "Lines added in .java:", added
|
||||
print "Lines removed in .java:", removed
|
||||
print "Net lines:", added - removed
|
||||
}'
|
||||
git log --author="$AUTHOR" --pretty=tformat: --numstat -- . ':(exclude)*Test.java' \
|
||||
| awk '
|
||||
$3 ~ /\.java$/ {
|
||||
added += $1
|
||||
removed += $2
|
||||
}
|
||||
END {
|
||||
print "Lines added in .java (excluding *Test.java):", added
|
||||
print "Lines removed in .java (excluding *Test.java):", removed
|
||||
print "Net lines:", added - removed
|
||||
}'
|
||||
Loading…
Add table
Add a link
Reference in a new issue