$ for year in {2002..2008}; do \ count=$( git log | grep ^Date: | grep $year | wc -l ); \ echo "Number of commits in $year: $count"; \ done Number of commits in 2002: 3094 Number of commits in 2003: 3283 Number of commits in 2004: 3851 Number of commits in 2005: 6006 Number of commits in 2006: 8431 Number of commits in 2007: 9532 Number of commits in 2008: 11292
-Hans
Hans Leidekker wrote:
$ for year in {2002..2008}; do \ count=$( git log | grep ^Date: | grep $year | wc -l ); \ echo "Number of commits in $year: $count"; \ done Number of commits in 2002: 3094 Number of commits in 2003: 3283 Number of commits in 2004: 3851 Number of commits in 2005: 6006 Number of commits in 2006: 8431 Number of commits in 2007: 9532 Number of commits in 2008: 11292
-Hans
I had a look at these stats as I'm (still) playing around with gitstat in combination with Wine. The numbers didn't match up so I had a closer look. 'git log' shows the author date and not the commit date.
So maybe this one is more correct?
$ for year in {2002..2008}; do \ count=$(git log --pretty='format:%cd' | grep $year | wc -l ); \ echo "Number of commits in $year: $count"; \ done Number of commits in 2002: 3094 Number of commits in 2003: 3283 Number of commits in 2004: 3851 Number of commits in 2005: 6006 Number of commits in 2006: 8404 Number of commits in 2007: 9540 Number of commits in 2008: 11307
Oh and btw, Happy New Year to all !
Hans Leidekker a écrit :
$ for year in {2002..2008}; do \ count=$( git log | grep ^Date: | grep $year | wc -l ); \ echo "Number of commits in $year: $count"; \ done Number of commits in 2002: 3094 Number of commits in 2003: 3283 Number of commits in 2004: 3851 Number of commits in 2005: 6006 Number of commits in 2006: 8431 Number of commits in 2007: 9532 Number of commits in 2008: 11292
-Hans
digging a bit deeper: for year in {2002..2008}; do \ count=$( git log | grep -2 -e "^Date.*$year" | grep ^Author: | sed -e 's/<.*>//' | LC_ALL=C sort -u -f | wc -l ); \ echo "Number of committers $count in year: $year"; \ done Number of committers 185 in year: 2002 Number of committers 166 in year: 2003 Number of committers 183 in year: 2004 Number of committers 211 in year: 2005 Number of committers 197 in year: 2006 Number of committers 217 in year: 2007 Number of committers 234 in year: 2008
of course, this doesn't take into account the different names used by the same person (ie there is for example a "frangois gouget" in the committers' list...) but this gives a good idea of the variation A+