[#6388] wrapper script to run call_counts.py for a range of git commits
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/15225cd8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/15225cd8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/15225cd8
Branch: refs/heads/master
Commit: 15225cd831b0baa70ee11256061fc4dda7773780
Parents: 78c0364
Author: Dave Brondsema <dbrondsema@slashdotmedia.com>
Authored: Fri Dec 20 19:02:51 2013 +0000
Committer: Tim Van Steenburgh <tvansteenburgh@gmail.com>
Committed: Thu Jan 2 16:16:21 2014 +0000
----------------------------------------------------------------------
scripts/perf/call_count_walk_git.sh | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/15225cd8/scripts/perf/call_count_walk_git.sh
----------------------------------------------------------------------
diff --git a/scripts/perf/call_count_walk_git.sh b/scripts/perf/call_count_walk_git.sh
new file mode 100755
index 0000000..8bb41ba
--- /dev/null
+++ b/scripts/perf/call_count_walk_git.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+if [[ $@ ]]
+then
+ revs=$@
+else
+ revs='HEAD -n 10'
+ echo "No git revision range given, using $revs"
+ echo "Other range formats like bdde98d..HEAD work too"
+ echo
+fi
+
+current=`git rev-parse --abbrev-ref HEAD`
+git rev-list --reverse $revs --oneline | while read commit
+do
+ echo $commit
+ sha=${commit:0:7}
+ git checkout -q $sha || { echo "Could not check out $sha, stopping. You started on $current";
break; }
+ ./call_count.py --id "$commit"
+done
+git checkout -q $current
\ No newline at end of file
|