From: Paul M. <le...@li...> - 2007-11-12 07:06:10
|
On Mon, Nov 12, 2007 at 03:19:05PM +0900, ?????? wrote: > In my opinion, gitstat has some bug, > Yes, it's totally broken. Here's a stupid comparison script I hacked up, maybe it's useful for someone: #!/bin/bash # # gitstat-cmp.sh # # Sample gitstat input: # 1 Adrian Bunk 45 # 2 Ralf Baechle 42 # 3 Alan Cox 25 # 4 David S. Miller 24 # 5 Jeff Garzik 24 # 6 Al Viro 19 # 7 Pavel Emelyanov 19 # 8 Tejun Heo 18 # 9 Paul Mundt 17 # # Sample gitstat-cmp.sh output: # # Bogus entry for "Adrian Bunk" (gitstat 45 kernel 137) # Bogus entry for "Ralf Baechle" (gitstat 42 kernel 143) # Bogus entry for "Alan Cox" (gitstat 25 kernel 70) # ... # # Example usage: sh ./gitstat-cmp.sh gitstat.txt . v2.6.23 v2.6.24-rc2 [ "$#" -ne "4" ] && \ echo "Usage: $0 <gitstat list> <kernel tree> <tag1> <tag2>" && exit 1 IFS=" " pushd $2 > /dev/null || exit 1 for line in $(sed -e 's/^[ \t]*[0-9]* //' < $1); do name=$(echo $line | sed -e 's/ .*$//;s/\t.*//') count=$(echo $line | sed -e "s/$name//g;s/^[ \t]*//;s/[ \t]*$//") for srcline in $(git shortlog $3..$4 | grep "^$name"); do srccount=$(echo $srcline | sed -e 's/.*(\(.*\)):.*$/\1/g') if [ "$count" -ne "$srccount" ]; then echo "Bogus entry for \"$name\" (gitstat $count kernel $srccount)" fi done done popd > /dev/null |