From 124d93ed3ea826cd16e4766f82b3c48af19cba5c Mon Sep 17 00:00:00 2001 From: Niels de Vos Date: Fri, 13 Sep 2013 15:54:52 +0200 Subject: extras: add script and config for generating "Who wrote GlusterFS" This script and configuration can be used to generate statistics similar to the "Who wrote " series available on http://lwn.net. Example usage for statistics from the initial branchpoint of 3.4 to the current development of the release-3.4 branch: $ extras/who-wrote-glusterfs/who-wrote-glusterfs.sh \ v3.4.0alpha...origin/release-3.4 By default the statistics will be calculated over the currently checked out branch. Change-Id: Ie7b8b655c50dcb14257e42599e2f89642c8b5b42 Signed-off-by: Niels de Vos Reviewed-on: http://review.gluster.org/5912 Reviewed-by: Amar Tumballi Tested-by: Amar Tumballi Reviewed-by: Harshavardhana Reviewed-by: Anand Avati --- extras/who-wrote-glusterfs/who-wrote-glusterfs.sh | 50 +++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100755 extras/who-wrote-glusterfs/who-wrote-glusterfs.sh (limited to 'extras/who-wrote-glusterfs/who-wrote-glusterfs.sh') diff --git a/extras/who-wrote-glusterfs/who-wrote-glusterfs.sh b/extras/who-wrote-glusterfs/who-wrote-glusterfs.sh new file mode 100755 index 000000000..487f5874b --- /dev/null +++ b/extras/who-wrote-glusterfs/who-wrote-glusterfs.sh @@ -0,0 +1,50 @@ +#!/bin/sh +# +# Gather statistics on "Who wrote GlusterFS". The idea comes from the excellent +# articles on http://lwn.net/ named "Who wrote ?". +# +# gitdm comes from git://git.lwn.net/gitdm.git by Jonathan Corbet. +# +# Confguration files used: +# - gitdm.config: main configuration file, pointing to the others +# - gitdm.aliases: merge users with different emailaddresses into one +# - gitdm.domain-map: map domain names from emailaddresses to companies +# + +DIRNAME=$(dirname $0) + +GITDM_REPO=git://git.lwn.net/gitdm.git +GITDM_DIR=${DIRNAME}/gitdm +GITDM_CMD="python ${GITDM_DIR}/gitdm" + +error() +{ + local ret=${?} + printf "${@}\n" > /dev/stderr + return ${ret} +} + +check_gitdm() +{ + if [ ! -e "${GITDM_DIR}/gitdm" ] + then + git clone --quiet git://git.lwn.net/gitdm.git ${DIRNAME}/gitdm + fi +} + +# The first argument is the revision-range (see 'git rev-list --help'). +# REV can be empty, and the statistics will be calculated over the whole +# current branch. +REV=${1} +shift +# all remaining options are passed to gitdm, see the gitdm script for an +# explanation of the accepted options. +GITDM_OPTS=${@} + +if ! check_gitdm +then + error "Could not find 'gitdm', exiting..." + exit 1 +fi + +git log --numstat -M ${REV} | ${GITDM_CMD} -b ${DIRNAME} -n ${GITDM_OPTS} -- cgit