From patchwork Tue Aug 2 02:36:55 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony Liguori X-Patchwork-Id: 107835 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 647F8B71BE for ; Tue, 2 Aug 2011 12:37:14 +1000 (EST) Received: from localhost ([::1]:52849 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qo4r1-0000iN-1z for incoming@patchwork.ozlabs.org; Mon, 01 Aug 2011 22:37:11 -0400 Received: from eggs.gnu.org ([140.186.70.92]:42241) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qo4qu-0000i7-S7 for qemu-devel@nongnu.org; Mon, 01 Aug 2011 22:37:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qo4qr-0001L1-32 for qemu-devel@nongnu.org; Mon, 01 Aug 2011 22:37:04 -0400 Received: from e3.ny.us.ibm.com ([32.97.182.143]:33434) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qo4qq-0001Kj-V7 for qemu-devel@nongnu.org; Mon, 01 Aug 2011 22:37:01 -0400 Received: from d01relay06.pok.ibm.com (d01relay06.pok.ibm.com [9.56.227.116]) by e3.ny.us.ibm.com (8.14.4/8.13.1) with ESMTP id p722D9CF016030 for ; Mon, 1 Aug 2011 22:13:09 -0400 Received: from d01av04.pok.ibm.com (d01av04.pok.ibm.com [9.56.224.64]) by d01relay06.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p722axAL1716232 for ; Mon, 1 Aug 2011 22:36:59 -0400 Received: from d01av04.pok.ibm.com (loopback [127.0.0.1]) by d01av04.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p722awFq006020 for ; Mon, 1 Aug 2011 22:36:58 -0400 Received: from titi.austin.rr.com (sig-9-65-17-121.mts.ibm.com [9.65.17.121]) by d01av04.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id p722av7g005906; Mon, 1 Aug 2011 22:36:57 -0400 From: Anthony Liguori To: qemu-devel@nongnu.org Date: Mon, 1 Aug 2011 21:36:55 -0500 Message-Id: <1312252615-31567-1-git-send-email-aliguori@us.ibm.com> X-Mailer: git-send-email 1.7.4.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Received-From: 32.97.182.143 Cc: Anthony Liguori , Alex Graf Subject: [Qemu-devel] [PATCH] [FYI] Scripts to generate project stats X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org As part of my talk for KVM Forum, I am collecting some stats on the project since last year. I thought I'd share the scripts in case anyone is interested in how they work. I think this is just about all of the data I need, but patches are certainly welcome. Of course, you'll have to come to KVM Forum to see the pretty version of these stats (there should be videos too for those that can't make it :-)) And thanks to Alex for poking me to collect these too. --- scripts/aliases.txt | 18 +++++++++ scripts/companies.txt | 20 ++++++++++ scripts/genstats.sh | 96 +++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 134 insertions(+), 0 deletions(-) create mode 100644 scripts/aliases.txt create mode 100644 scripts/companies.txt create mode 100755 scripts/genstats.sh diff --git a/scripts/aliases.txt b/scripts/aliases.txt new file mode 100644 index 0000000..aadea25 --- /dev/null +++ b/scripts/aliases.txt @@ -0,0 +1,18 @@ +andrew.zaborowski@intel.com: balrog@zabor.org +edgar@axis.com: edgar.iglesias@gmail.com +edgar.iglesias@petalogix.com: edgar.iglesias@gmail.com +lcapitulino@gmail.com: lcapitulino@redhat.com +riku.voipio@nokia.com: riku.voipio@linaro.org +riku.voipio@iki.fi: riku.voipio@linaro.org +andreas.faerber: andreas.faerber@web.de +anthony@codemonkey.ws: aliguori@us.ibm.com +atar4qemu@googlemail.com: atar4qemu@gmail.com +bernhard.kohl@gmx.net: bernhard.kohl@nsn.com +jan.kiszka@web.de: jan.kiszka@siemens.com +mail@kevin-wolf.de: kwolf@redhat.com +marcandre.lureau@gmail.com: marcandre.lureau@redhat.com +rth@twiddle.net: rth@redhat.com +sripathi@sripathi.in.ibm.com: sripathik@in.ibm.com + + + diff --git a/scripts/companies.txt b/scripts/companies.txt new file mode 100644 index 0000000..436e3b3 --- /dev/null +++ b/scripts/companies.txt @@ -0,0 +1,20 @@ +Red Hat: redhat.com hch@lst.de glommer@mothafucka.localdomain +SuSE: suse.de novell.com +IBM: ibm.com kernel.crashing.org gibson.dropbear.id.au +AMD: amd.com +Citrix: citrix.com +Canonical: canonical.com +Intel: intel.com +VIA: viatech.com.cn +Linaro: linaro +Google: google.com +Code Sourcery: codesourcery.com +Siemens: siemens.com siemens-enterprise.com +Fujitsu: fujitsu.com +Dream Host: dreamhost.com +Nokia: nokia.com +Samsung: samsung.com +NTT: lab.ntt.co.jp +FreeScale: freescale.com +XenSource: xensource.com +VA Linux: valinux.co.jp diff --git a/scripts/genstats.sh b/scripts/genstats.sh new file mode 100755 index 0000000..6d1228f --- /dev/null +++ b/scripts/genstats.sh @@ -0,0 +1,96 @@ +#!/bin/bash + +# Usage: scripts/genstats.sh "today" "1 year ago" + +aliases="scripts/aliases.txt" +companies="scripts/companies.txt" + +function dedup() { + while read addr; do + f=`grep "^$addr: " "$aliases" | cut -f2- -d' '` + if test "$f"; then + echo "$f" + else + echo "$addr" + fi + done +} + +function gen-committers() { + until="$1" + since="$2" + + git log --until="$until" --since="$since" --pretty=format:%ce | \ + sort -u | dedup | sort -u | while read committer; do + addresses=`grep " $committer\$" "$aliases" | cut -f1 -d: | while read a; do echo -n "--committer=$a "; done` + + echo -n "$committer, " + git log --until="$until" --since="$since" \ + --pretty=oneline --committer="$committer" $addresses | wc -l + done +} + +function gen-authors() { + until="$1" + since="$2" + + git log --until="$until" --since="$since" --pretty=format:%ae | \ + sort -u | dedup | sort -u | while read author; do + addresses=`grep " $author\$" "$aliases" | cut -f1 -d: | while read a; do echo -n "--author=$a "; done` + + echo -n "$author, " + git log --until="$until" --since="$since" \ + --pretty=oneline --author="$author" | wc -l + done +} + +function gen-commits() { + until="$1" + since="$2" + + git log --until="$until" --since="$since" --pretty=oneline | wc -l +} + +function gen-companies() { + until="$1" + since="$2" + + cat "$companies" | while read LINE; do + company=`echo $LINE | cut -f1 -d:` + addrs=`echo $LINE | cut -f2- -d:` + + authors=`echo "$addrs" | sed -e 's: : --author=:g'` + echo "$company," \ + `git log --until="$until" --since="$since" --pretty=oneline \ + $authors | wc -l`, \ + `git log --until="$until" --since="$since" --pretty="format:%ae\n" \ + $authors | sort -u | dedup | sort -u | wc -l` + done +} + +function gen-stats() { + until="$1" + since="$2" + + echo 'Total Commits' + echo '-------------' + gen-commits "$until" "$since" + echo + + echo 'Committers' + echo '----------' + gen-committers "$until" "$since" + echo + + echo 'Authors' + echo '-------' + gen-authors "$until" "$since" + echo + + echo 'Companies' + echo '---------' + gen-companies "$util" "$since" +} + +gen-stats "$1" "$2" +