aboutsummaryrefslogtreecommitdiff
path: root/externals/gridflow/bin/plusminus
diff options
context:
space:
mode:
authorN.N. <matju@users.sourceforge.net>2008-07-08 05:56:10 +0000
committerN.N. <matju@users.sourceforge.net>2008-07-08 05:56:10 +0000
commit089475041fe26964d72cb2ebc3559a36ba89a2f2 (patch)
tree4ea7537e82b2ee34748ef7cbfc18c523425d4f7a /externals/gridflow/bin/plusminus
parentd1ad56f1da41e7a88eb9a52d6b0daaf145b54ea7 (diff)
trying to import gridflow 0.9.4
svn path=/trunk/; revision=10148
Diffstat (limited to 'externals/gridflow/bin/plusminus')
-rwxr-xr-xexternals/gridflow/bin/plusminus39
1 files changed, 39 insertions, 0 deletions
diff --git a/externals/gridflow/bin/plusminus b/externals/gridflow/bin/plusminus
new file mode 100755
index 00000000..685014ce
--- /dev/null
+++ b/externals/gridflow/bin/plusminus
@@ -0,0 +1,39 @@
+#!/usr/bin/env ruby
+# NOTE: this works with diff -u only!!!
+
+puts "-"*64
+
+$plustot=0
+$minustot=0
+
+def show
+ printf "%20s %+5d %+5d (net %+5d)\n", $file, $plus, -$minus, $plus-$minus
+end
+
+loop{
+ line = gets
+ break if not line
+ if /^diff/.match line then
+ x = line.split(/\s+/)
+ $plustot+=$plus if $plus
+ $minustot+=$minus if $minus
+ show if $file
+ $file = x[-1]
+ $on=false
+ $plus=0
+ $minus=0
+ elsif /^\@\@/ =~ line then $on=true
+ elsif $on and /^\+/ =~ line then $plus+=1
+ elsif $on and /^\-/ =~ line then $minus+=1
+ end
+}
+
+$plustot+=$plus if $plus
+$minustot+=$minus if $minus
+show if $file
+
+$file="total"
+$plus=$plustot
+$minus=$minustot
+puts "-"*64
+show