Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(72)

Unified Diff: webrtc/tools/author_line_count

Issue 2061683002: New misc scripts, header_usage.sh and author_line_count.sh. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webrtc/tools/header_usage » ('j') | webrtc/tools/header_usage » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 }
+'
+
« no previous file with comments | « no previous file | webrtc/tools/header_usage » ('j') | webrtc/tools/header_usage » ('J')

Powered by Google App Engine
This is Rietveld 408576698