Created
February 25, 2010 10:11
-
-
Save co3k/314434 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| set_include_path(get_include_path().PATH_SEPARATOR.'/home/co3k/develop/VersionControl_Git/'); | |
| require_once 'VersionControl/Git.php'; | |
| $svnToGit = array( | |
| 'ebihara <ebihara@8bbc783d-d51a-0410-adab-8fa69d43f207>' => 'Kousuke Ebihara <ebihara@tejimaya.com>', | |
| 'nagasawa <nagasawa@8bbc783d-d51a-0410-adab-8fa69d43f207>' => 'Masato Nagasawa <nagasawa@tejimaya.com>', | |
| 'shingo <shingo@8bbc783d-d51a-0410-adab-8fa69d43f207>' => 'Shingo Yamada <s.yamada@tejimaya.com>', | |
| 'fukamachi <fukamachi@8bbc783d-d51a-0410-adab-8fa69d43f207>' => 'fukamachi <e.arrows@gmail.com>', | |
| 'kawahara <kawahara@8bbc783d-d51a-0410-adab-8fa69d43f207>' => 'Shogo Kawahara <ooharabucyou@gmail.com>', | |
| 'urabe <urabe@8bbc783d-d51a-0410-adab-8fa69d43f207>' => 'Shinichi Urabe <urabe@tejimaya.com>', | |
| 'urabe <urabe@debian.localdomain>' => 'Shinichi Urabe <urabe@tejimaya.com>', | |
| 'nothan <private@nothan.xrea.jp>' => 'Masato Nagasawa <nagasawa@tejimaya.com>', | |
| 'ogawa <ogawa@8bbc783d-d51a-0410-adab-8fa69d43f207>' => 'Rimpei Ogawa <ogawa@tejimaya.com>', | |
| ); | |
| $repopath = './OpenPNE3'; | |
| $repo = new VersionControl_Git($repopath); | |
| $revlist = $repo->getRevListFetcher(); | |
| $commits = $revlist->fetch(); | |
| $authors = array(); | |
| foreach ($commits as $commit) | |
| { | |
| $authors[] = $commit->getAuthor(); | |
| } | |
| $authors = array_unique($authors); | |
| $ranking = array(); | |
| foreach ($authors as $author) | |
| { | |
| $revlist->setOption('author', $author); | |
| $count = count($revlist->fetch()); | |
| $_author = $author; | |
| if (isset($svnToGit[$_author])) | |
| { | |
| $_author = $svnToGit[$_author]; | |
| } | |
| if (empty($ranking[$_author])) | |
| { | |
| $ranking[$_author] = 0; | |
| } | |
| $ranking[$_author] += $count; | |
| } | |
| arsort($ranking); | |
| $i = 1; | |
| foreach ($ranking as $author => $rank) | |
| { | |
| echo $i.'位 ('.$rank.'回)'."\t".$author.PHP_EOL; | |
| $i++; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment