Add useless git-bloat script
authorBernie Innocenti <bernie@codewiz.org>
Wed, 19 Aug 2009 09:46:37 +0000 (11:46 +0200)
committerBernie Innocenti <bernie@codewiz.org>
Wed, 19 Aug 2009 09:46:37 +0000 (11:46 +0200)
git-bloat [new file with mode: 0755]
git-cat

diff --git a/git-bloat b/git-bloat
new file mode 100755 (executable)
index 0000000..ef73cff
--- /dev/null
+++ b/git-bloat
@@ -0,0 +1,13 @@
+#!/bin/bash
+# Copyright 2009 Bernie Innocenti <bernie@codewiz.org>
+
+if [ $# -ne 1 ]; then
+       echo "Usage: $0 {path}"
+       exit 1
+fi
+
+git log --pretty=oneline "$1" | while read log; do
+       tree=($log)
+       rev=`git ls-tree ${tree[0]} "$1" | awk '{print $3}'`
+       git cat-file blob $rev | wc -l
+done | tac | graph -T X -a 1 -y 0 1000 -X revisions -Y LOCs
diff --git a/git-cat b/git-cat
index bf58c40ae2fa90e2d16d7849868df04bfb7d7431..91c3eb9f7294086d13b8027ea688244b42d01fce 100755 (executable)
--- a/git-cat
+++ b/git-cat
@@ -1,4 +1,7 @@
-if [ $# -ne 1 ] ; then
+#!/bin/bash
+# Copyright 2009 Bernie Innocenti <bernie@codewiz.org>
+
+if [ $# -ne 1 ]; then
        echo "Usage: $0 {path}"
        exit 1
 fi