Index: webrtc/tools/author_line_count |
diff --git a/webrtc/tools/author_line_count b/webrtc/tools/author_line_count |
new file mode 100755 |
index 0000000000000000000000000000000000000000..446cf4c4b99f11d9eeae9f49f8289f8afdb21743 |
--- /dev/null |
+++ b/webrtc/tools/author_line_count |
@@ -0,0 +1,15 @@ |
+#! /bin/sh |
kjellander_webrtc
2016/06/13 12:49:52
Provide a brief description.
kjellander_webrtc
2016/06/13 12:49:52
Change to #!/bin/bash
nisse-webrtc
2016/06/14 09:38:47
Done.
kjellander_webrtc
2016/06/14 14:11:12
Not done :) Still needs to remove the space.
nisse-webrtc
2016/06/15 06:55:23
Ok. That's unorthodox, script files are traditiona
|
+ |
+AUTHOR=$1 |
+if [ -z "$AUTHOR" ] ; then |
kjellander_webrtc
2016/06/13 12:49:51
Prefer brace-quoting of multiple-character variabl
kjellander_webrtc
2016/06/13 12:49:52
Use [[ ]] style test.
https://engdoc.corp.google.c
nisse-webrtc
2016/06/14 09:38:46
Done.
|
+ echo "Usage: $0 AUTHOR-PATTERN" |
+ exit 1 |
+fi |
+ |
+git log --author="$AUTHOR" --oneline --shortstat | grep '^ ' | gawk ' |
+BEGIN { RS=",|\n" } |
+/insertion/ { total += $1 } |
+/deletion/ { total -= $1 } |
+END { print total } |
+' |
+ |