{"thread":{"id":"6084","subject":"author/commit counts","startedAt":"2006-12-23T02:10:30Z","lastAt":"2006-12-23T14:31:00Z","messageCount":12,"participants":["Randy Dunlap","Shawn Pearce","Randal L. Schwartz","Junio C Hamano","Linus Torvalds","Nicolas Pitre","Johannes Schindelin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"30134","messageId":"20061222181030.d733deb3.rdunlap@xenotime.net","threadId":"6084","inReplyTo":null,"subject":"author/commit counts","fromName":"Randy Dunlap","fromEmail":"rdunlap@xenotime.net","sentAt":"2006-12-23T02:10:30Z","receivedAt":"2006-12-23T02:10:30Z","isPatch":false,"sender":{"key":"rdunlap@xenotime.net","avatar":null},"body":"Hi,\n\nSomeone asked me a few days ago about their patches being merged yet\n(e.g., how to see their commits in a git tree).\nSomeone else asked (in general) about commit or author counts.\n\nI pointed the first person to \"git log\" and/or gitweb.\nFor the second, there are probably lots of scripts out there\nbut I didn't find them.  Where are they?\n\nIs this useful?  or it needs fixing?\nor you already have better solutions?\n\nexample:\ngit log v2.6.19.. | authorcount -m | less\n\n# this is just the ones with >= 50 Author: lines\n\nAl Viro : 213\nLinus Torvalds : 94\nJiri Slaby : 90\nJosef Sipek : 79\nGerrit Renker : 77\nAdrian Bunk : 67\nAndrew Morton : 59\nTejun Heo : 52\nMariusz Kozlowski : 52\nPaul Mundt : 51\nRalf Baechle : 50\n---\n\n#! /usr/bin/perl\n# Copyright (C) 2006, Randy Dunlap.\n\n# read stdin, drop non-author: lines, count/sum/tally author: lines by\n# each author after sanitizing author-name somewhat.\n#\n# optionally print out in author-name (-a) alpha order\n# or in numeric/count (-n) order (low-to-high)\n# or in numeric/count (-m) order (high-to-low) (\"max\" first)\n\n# hash for author names:\nmy %authors;\nmy $auth;\nmy $sortby;\n\nsub usage()\n{\n\tprint \"usage: authorcount [-a | -n | -m] < git.log.lines\\n\";\n\texit(1);\n}\n\n$sortby = $ARGV[0];\nif (($sortby ne \"\") && ($sortby ne \"-a\") && ($sortby ne \"-n\") &&\n    ($sortby ne \"-m\"))\n{\n\tprint \"Invalid sort option: $sortby\\n\";\n\tusage();\n}\n\nREADIN: while ($line = <STDIN>)\n{\n\tchomp $line;\n\tnext READIN if $line !~ /Author:/;\n\n\t$auth = $line;\n\t$auth =~ s/Author: //;\n\t$auth =~ s/<.*>//;\n\n\t$authors{$auth}++;\n\n} # end READIN\n\nsub byvalue\n{\n\t$authors{$a} <=> $authors{$b};\n}\n\n# optionally sort by author name or author counts\n# print out the tally array\n\nif ($sortby eq \"-a\")\n{\n\tforeach $auth (sort keys %authors)\n\t{\n\t\tprint \"$auth: $authors{$auth}\\n\";\n\t}\n}\nelsif ($sortby eq \"-n\")\n{\n\tforeach $auth (sort byvalue keys %authors)\n\t{\n\t\tprint \"$auth: $authors{$auth}\\n\";\n\t}\n}\nelsif ($sortby eq \"-m\")\n{\n\tforeach $auth (reverse sort byvalue keys %authors)\n\t{\n\t\tprint \"$auth: $authors{$auth}\\n\";\n\t}\n}\nelse # no sort, just hash order\n{\n\twhile (($auth, $count) = each(%authors))\n\t{\n\t\tprint \"$auth: $count\\n\";\n\t}\n}\n"},{"id":"30135","messageId":"20061223023719.GA8734@spearce.org","threadId":"6084","inReplyTo":"20061222181030.d733deb3.rdunlap@xenotime.net","subject":"Re: author/commit counts","fromName":"Shawn Pearce","fromEmail":"spearce@spearce.org","sentAt":"2006-12-23T02:37:20Z","receivedAt":"2006-12-23T02:37:20Z","isPatch":false,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Randy Dunlap <rdunlap@xenotime.net> wrote:\n> Someone asked me a few days ago about their patches being merged yet\n> (e.g., how to see their commits in a git tree).\n> Someone else asked (in general) about commit or author counts.\n\nI often do `git log --author=Shawn next@{1}..next` to see what\ncommits of mine Junio has recently merged into git.git since my\nlast fetch.  Since I'm the only Shawn (with that spelling) that\ncontributes to git.git this works rather well to show my work.  ;-)\n \n> I pointed the first person to \"git log\" and/or gitweb.\n> For the second, there are probably lots of scripts out there\n> but I didn't find them.  Where are they?\n\nHere's another variant showing the top 20 committers to git.git,\nno Perl involved:\n\n  $ git log | grep ^Author | cut -d\\< -f1 | sort \\\n  \t| uniq -c | sort -n -r | head -20\n  3728 Author: Junio C Hamano \n   842 Author: Linus Torvalds \n   250 Author: Johannes Schindelin \n   217 Author: Jakub Narebski \n   194 Author: Eric Wong \n   166 Author: Petr Baudis \n   150 Author: Paul Mackerras \n   147 Author: Kay Sievers \n    88 Author: Nicolas Pitre \n    77 Author: Rene Scharfe \n    67 Author: Shawn Pearce \n    57 Author: Martin Langhoff \n    53 Author: Fredrik Kuivinen \n    52 Author: Nick Hengeveld \n    52 Author: Matthias Urlichs \n    49 Author: Daniel Barkalow \n    47 Author: Ryan Anderson \n    46 Author: Shawn O. Pearce \n    45 Author: Sergey Vlasov \n    45 Author: Luben Tuikov \n\nThe only issue I have with that is I seem to have two attributions\nin git.git: 'Shawn Pearce' and 'Shawn O. Pearce'.  Technically I'm\nin the top 10 by commit volume but its not immediately clear because\nof the two attributions being used.  Really my only issue here is\nwhy sometimes my middle initial gets used and other times it doesn't.\n\nYou can also see the very clear gap between Junio and the rest of the\nworld.  There's very little dispute about who really codes Git.  :-)\n\nI'm personally suprised at Pasky's ranking: 166 commits!  I did\nnot realize he had contributed so frequently to git.git itself.\n\n-- \nShawn.\n"},{"id":"30142","messageId":"86vek3p6s3.fsf@blue.stonehenge.com","threadId":"6084","inReplyTo":"20061222181030.d733deb3.rdunlap@xenotime.net","subject":"Re: author/commit counts","fromName":"Randal L. Schwartz","fromEmail":"merlyn@stonehenge.com","sentAt":"2006-12-23T04:37:00Z","receivedAt":"2006-12-23T04:37:00Z","isPatch":false,"sender":{"key":"merlyn@stonehenge.com","avatar":"https://gravatar.com/avatar/dc528d210743ff0333e6213f9ee7b33b23f1b7bc1f3c5a8c2d819074ecd7ab19?d=mp&s=160"},"body":">>>>> \"Randy\" == Randy Dunlap <rdunlap@xenotime.net> writes:\n\nRandy> example:\nRandy> git log v2.6.19.. | authorcount -m | less\n\nRandy> # this is just the ones with >= 50 Author: lines\n\nRandy> Al Viro : 213\nRandy> Linus Torvalds : 94\nRandy> Jiri Slaby : 90\nRandy> Josef Sipek : 79\nRandy> Gerrit Renker : 77\nRandy> Adrian Bunk : 67\nRandy> Andrew Morton : 59\nRandy> Tejun Heo : 52\nRandy> Mariusz Kozlowski : 52\nRandy> Paul Mundt : 51\nRandy> Ralf Baechle : 50\nRandy> ---\n\nWith\n\n  git-log --pretty=short v2.6.19.. |  git-shortlog -n -s | head -10\n\nand no additional tools, I get:\n\n    Al Viro: 213\n    Linus Torvalds: 94\n    Jiri Slaby: 90\n    Josef Sipek: 79\n    Gerrit Renker: 77\n    Adrian Bunk: 67\n    Andrew Morton: 59\n    Tejun Heo: 52\n    Mariusz Kozlowski: 52\n    Paul Mundt: 51\n\nLooky there.\n\n-- \nRandal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095\n<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>\nPerl/Unix/security consulting, Technical writing, Comedy, etc. etc.\nSee PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!\n"},{"id":"30143","messageId":"7vfyb7usqd.fsf@assigned-by-dhcp.cox.net","threadId":"6084","inReplyTo":"20061222181030.d733deb3.rdunlap@xenotime.net","subject":"Re: author/commit counts","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-12-23T04:43:54Z","receivedAt":"2006-12-23T04:43:54Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Randy Dunlap <rdunlap@xenotime.net> writes:\n\n> Is this useful?  or it needs fixing?\n> or you already have better solutions?\n>\n> example:\n> git log v2.6.19.. | authorcount -m | less\n\nPerhaps you are talking about this command?\n\n$ git shortlog -n -s v2.6.19..\n"},{"id":"30144","messageId":"Pine.LNX.4.64.0612222038570.3671@woody.osdl.org","threadId":"6084","inReplyTo":"20061223023719.GA8734@spearce.org","subject":"Re: author/commit counts","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2006-12-23T04:44:15Z","receivedAt":"2006-12-23T04:44:15Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Fri, 22 Dec 2006, Shawn Pearce wrote:\n> \n> Here's another variant showing the top 20 committers to git.git,\n> no Perl involved:\n\nThis is what I've done a few times. For the kernel, I actually find the \n\"Signed-off-by:\" lines to be more relevant to me (since it shows a \ncombination of authorship and maintainership, something that I value a lot \npersonally), but I've done statistics on both authors and signers-off )and \ncommitters, but that mainly just shows who uses git to sync and who does \nnot), and I've never written any real scripts for it, I just end up doing \nit with some one-liner shell thing using grep, cut, sort and uniq.\n\n\t\tLinus\n"},{"id":"30145","messageId":"Pine.LNX.4.64.0612230001590.18171@xanadu.home","threadId":"6084","inReplyTo":"20061222181030.d733deb3.rdunlap@xenotime.net","subject":"Re: author/commit counts","fromName":"Nicolas Pitre","fromEmail":"nico@cam.org","sentAt":"2006-12-23T05:06:39Z","receivedAt":"2006-12-23T05:06:39Z","isPatch":false,"sender":{"key":"nico@fluxnic.net","avatar":"https://avatars.githubusercontent.com/u/702790?v=4"},"body":"On Fri, 22 Dec 2006, Randy Dunlap wrote:\n\n> Hi,\n> \n> Someone asked me a few days ago about their patches being merged yet\n> (e.g., how to see their commits in a git tree).\n\nSee the --author=<string> option to git log.\n\n> Someone else asked (in general) about commit or author counts.\n> \n> I pointed the first person to \"git log\" and/or gitweb.\n> For the second, there are probably lots of scripts out there\n> but I didn't find them.  Where are they?\n\nTry git shortlog -s.  If you combine the two like:\n\n\tgit log --author=<blah> | git shortlog -s\n\nthen you'll have a commit count for <blah> only.\n\n\nNicolas\n"},{"id":"30148","messageId":"20061222212449.dd5bf939.rdunlap@xenotime.net","threadId":"6084","inReplyTo":"7vfyb7usqd.fsf@assigned-by-dhcp.cox.net","subject":"Re: author/commit counts","fromName":"Randy Dunlap","fromEmail":"rdunlap@xenotime.net","sentAt":"2006-12-23T05:24:49Z","receivedAt":"2006-12-23T05:24:49Z","isPatch":false,"sender":{"key":"rdunlap@xenotime.net","avatar":null},"body":"On Fri, 22 Dec 2006 20:43:54 -0800 Junio C Hamano wrote:\n\n> Randy Dunlap <rdunlap@xenotime.net> writes:\n> \n> > Is this useful?  or it needs fixing?\n> > or you already have better solutions?\n> >\n> > example:\n> > git log v2.6.19.. | authorcount -m | less\n> \n> Perhaps you are talking about this command?\n> \n> $ git shortlog -n -s v2.6.19..\n\nYes, thanks, probably something like that....\n\ngit version 1.4.3.GIT\n\n> git shortlog -n -s v2.6.19..\nCan't open v2.6.19..: No such file or directory at /usr/local/bin/git-shortlog line 99.\n\n---\n~Randy\n"},{"id":"30149","messageId":"20061222212710.27cb8396.rdunlap@xenotime.net","threadId":"6084","inReplyTo":"86vek3p6s3.fsf@blue.stonehenge.com","subject":"Re: author/commit counts","fromName":"Randy Dunlap","fromEmail":"rdunlap@xenotime.net","sentAt":"2006-12-23T05:27:10Z","receivedAt":"2006-12-23T05:27:10Z","isPatch":false,"sender":{"key":"rdunlap@xenotime.net","avatar":null},"body":"On 22 Dec 2006 20:37:00 -0800 Randal L. Schwartz wrote:\n\n> >>>>> \"Randy\" == Randy Dunlap <rdunlap@xenotime.net> writes:\n> \n> Randy> example:\n> Randy> git log v2.6.19.. | authorcount -m | less\n> \n> Randy> # this is just the ones with >= 50 Author: lines\n> \n> Randy> Al Viro : 213\n> Randy> Linus Torvalds : 94\n> Randy> Jiri Slaby : 90\n> Randy> Josef Sipek : 79\n> Randy> Gerrit Renker : 77\n> Randy> Adrian Bunk : 67\n> Randy> Andrew Morton : 59\n> Randy> Tejun Heo : 52\n> Randy> Mariusz Kozlowski : 52\n> Randy> Paul Mundt : 51\n> Randy> Ralf Baechle : 50\n> Randy> ---\n> \n> With\n> \n>   git-log --pretty=short v2.6.19.. |  git-shortlog -n -s | head -10\n> \n> and no additional tools, I get:\n> \n>     Al Viro: 213\n>     Linus Torvalds: 94\n>     Jiri Slaby: 90\n>     Josef Sipek: 79\n>     Gerrit Renker: 77\n>     Adrian Bunk: 67\n>     Andrew Morton: 59\n>     Tejun Heo: 52\n>     Mariusz Kozlowski: 52\n>     Paul Mundt: 51\n> \n> Looky there.\n\nYep, that's nice.  Thanks.\n\n---\n~Randy\n"},{"id":"30151","messageId":"20061223052929.GA9396@spearce.org","threadId":"6084","inReplyTo":"20061222212449.dd5bf939.rdunlap@xenotime.net","subject":"Re: author/commit counts","fromName":"Shawn Pearce","fromEmail":"spearce@spearce.org","sentAt":"2006-12-23T05:29:29Z","receivedAt":"2006-12-23T05:29:29Z","isPatch":false,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Randy Dunlap <rdunlap@xenotime.net> wrote:\n> Yes, thanks, probably something like that....\n> \n> git version 1.4.3.GIT\n> \n> > git shortlog -n -s v2.6.19..\n> Can't open v2.6.19..: No such file or directory at /usr/local/bin/git-shortlog line 99.\n\nThe git-shortlog being discussed is the new builtin shortlog,\nwhich has not been released yet.  Try the 'master' branch in git.git.\n\n-- \nShawn.\n"},{"id":"30198","messageId":"Pine.LNX.4.63.0612231521340.19693@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"6084","inReplyTo":"Pine.LNX.4.64.0612230001590.18171@xanadu.home","subject":"Re: author/commit counts","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-12-23T14:22:25Z","receivedAt":"2006-12-23T14:22:25Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sat, 23 Dec 2006, Nicolas Pitre wrote:\n\n> \tgit log --author=<blah> | git shortlog -s\n\nNote that the builtin shortlog reuses the fine revision walking machinery:\n\n\tgit shortlog --author=<blah> -n -s\n\nworks like a charm.\n\nCiao,\nDscho\n"},{"id":"30201","messageId":"loom.20061223T152605-994@post.gmane.org","threadId":"6084","inReplyTo":"20061223023719.GA8734@spearce.org","subject":"Re: author/commit counts","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-12-23T14:28:00Z","receivedAt":"2006-12-23T14:28:00Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Shawn Pearce <spearce <at> spearce.org> writes:\n\n>   $ git log | grep ^Author | cut -d\\< -f1 | sort \\\n>   \t| uniq -c | sort -n -r | head -20\n\nAs Junio pointed out in another mail, \"git shortlog -n -s | head -20\" is\nshorter...\n\n> You can also see the very clear gap between Junio and the rest of the\n> world.  There's very little dispute about who really codes Git.  \n\nNote that this still holds when doing the technically correct thing:\n\n$ git shortlog -n -s --no-merges\n\nCiao,\nDscho\n"},{"id":"30202","messageId":"Pine.LNX.4.64.0612230929410.18171@xanadu.home","threadId":"6084","inReplyTo":"Pine.LNX.4.63.0612231521340.19693@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: author/commit counts","fromName":"Nicolas Pitre","fromEmail":"nico@cam.org","sentAt":"2006-12-23T14:31:00Z","receivedAt":"2006-12-23T14:31:00Z","isPatch":false,"sender":{"key":"nico@fluxnic.net","avatar":"https://avatars.githubusercontent.com/u/702790?v=4"},"body":"On Sat, 23 Dec 2006, Johannes Schindelin wrote:\n\n> Hi,\n> \n> On Sat, 23 Dec 2006, Nicolas Pitre wrote:\n> \n> > \tgit log --author=<blah> | git shortlog -s\n> \n> Note that the builtin shortlog reuses the fine revision walking machinery:\n> \n> \tgit shortlog --author=<blah> -n -s\n> \n> works like a charm.\n\nI know and use it myself.  But many people might not have a recent \nenough git version for that.\n\n\nNicolas\n"}]}