-
Notifications
You must be signed in to change notification settings - Fork 6
/
git-company
executable file
·193 lines (157 loc) · 6.57 KB
/
git-company
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
#!/usr/bin/perl
use strict;
use Data::Dumper;
#my @lines = `git shortlog --summary --numbered --email`; # all time
#my @lines = `git shortlog --summary --numbered --email dc61d1bea083`; # since 2018
my @lines = `git shortlog --summary --numbered --email 448bd578..HEAD`; #
my %hosts;
# To see just commits find a hash:
# git log --since=2018-01-01 | tail
#
# This is a rough script that maps users to companies so we
# can get a rough ranking of contributions.
#
# To make more metadata:
# manual: git log --author=XYZ
# then find commit in their name and look them up in the tracker
# then google them to find more details and track who they are
# and add it to the array below
#
my %map = (
# Moodle HQ
'moodler' => 'moodle.org',
'martin' => 'moodle.org',
'moodlerobot' => 'totara.com',
'moodle.com' => 'moodle.org',
'stronk7' => 'moodle.org',
'mudrd8mz' => 'moodle.org',
'[email protected]' => 'moodle.org',
'[email protected]' => 'moodle.org',
'[email protected]' => 'moodle.org',
'[email protected]' => 'moodle.org',
'[email protected]' => 'moodle.org',
'[email protected]' => 'moodle.org',
'[email protected]' => 'moodle.org',
'ryanwyllie.com' => 'moodle.org',
'nicols.co.uk' => 'moodle.org',
'jerome' => 'moodle.org',
'dongsheng' => 'moodle.org',
'[email protected]' => 'moodle.org',
'[email protected]' => 'moodle.org',
'mouneyrac.com' => 'moodle.org', # since left
'server2.moodle.com' => 'moodle.org',
'[email protected]' => 'moodle.org',
'[email protected]' => 'moodle.org',
'poltawski' => 'moodle.org',
'vyshane' => 'moodle.org',
'ethem' => 'moodle.org',
'toyomoyo' => 'moodle.org', # NOT SURE very old < 2.0 commits
'koenr' => 'moodle.org', # NOT SURE very old < 2.0 commits
'defacer' => 'moodle.org', # NOT SURE very old < 2.0 commits
'paca70' => 'moodle.org',
'rkingdon' => 'moodle.org',
'michaelpenne' => 'moodle.org',
'scyrma' => 'moodle.org', # skoda when at moodle hq
'[email protected]' => 'moodle.org', # since left
'moodle.org' => 'moodle.org Moodle HQ',
## Partners
# Totara
'skodak' => 'totaralms.com',
'samhemelryk' => 'totaralms.com',
'skodak.org' => 'totaralms.com',
'[email protected]' => 'totaralms.com',
'jerome' => 'totaralms.com',
'[email protected]' => 'totaralms.com',
'totara.com' => 'totaralms.com',
'totaralms.com' => 'totaralms.com Totara HQ',
# Catalyst
'nigelcunningham.com.au' => 'catalyst.net.nz',
'piers' => 'catalyst.net.nz',
'danmarsden.com' => 'catalyst.net.nz',
'danmarsden' => 'catalyst.net.nz',
'mattc-catalyst' => 'catalyst.net.nz',
# 'catalyst-au.net' => 'catalyst.net.nz',
'catalyst-au.net' => 'catalyst-au.net',
'mylescarrick.com' => 'catalyst.net.nz',
'jonathanharker' => 'catalyst.net.nz',
'mjollnir_' => 'catalyst.net.nz',
'catalyst.net.nz' => 'catalyst.net.nz Partner NZ',
# Remote Learner
'martinlanghoff' => 'remote-learner.net',
'remote-learner.net' => 'remote-learner.net Partner Canada',
'synergy-learning.com' => 'synergy-learning.com Partner Synergy learning',
'[email protected]' => 'adapta.online Partner',
'Nashtechglobal.com' => 'nashtechglobal.com',
# Mitstek
'mits' => 'mitstek.com',
'mitstek.com' => 'mitstek.com Partner Japan',
# netspot.com.au
'netspot.com.au' => 'netspot.com.au Partner Aus',
## Big universities
# Uni
'bobopinna' => 'uniupo.it',
'uniupo.it' => 'uniupo.it Uni: Eastern Piedmont Italy',
'[email protected]' => 'psc.ac.uk Uni: Peter Symonds College',
# Edith Cowan uni
'nicolasconnault' => 'ecu.edu.au',
'[email protected]' => 'ecu.edu.au',
'ecu.edu.au' => 'ecu.edu.au Uni: Edith Cowan',
'gustav_delius' => 'york.ac.uk',
'york.ac.uk' => 'york.ac.uk Uni: York, UK',
'martignoni' => 'fri-tic.ch',
'fri-tic.ch' => 'fri-tic.ch Uni: Swiss',
'gbateson' => 'kochi-tech.ac.jp',
'kochi-tech.ac.jp' => 'kochi-tech.ac.jp Uni: Kochi Japan',
# Open Uni
'tjhunt' => 'open.ac.uk',
'sam_marshall' => 'open.ac.uk',
'nfreear' => 'open.ac.uk',
'open.ac.uk' => 'open.ac.uk Uni: Open Uni UK',
'thepurpleblob' => 'gla.ac.uk',
'gla.ac.uk' => 'gla.ac.uk Uni: Glasgow UK',
# Freelance moodle dev
'jamiesensei' => 'jamiep.org',
'jamiep.org' => 'jamiep.org Freelance Moodle dev',
'urs_hunkler' => 'unodo.de',
'unodo.de' => 'unodo.de Freelance Moodle dev',
'luns.net.uk' => 'luns.net.uk Dev',
);
my $c = 0;
foreach my $line (@lines){
# if ($c++ > 200){ last; }
$line =~ /(\d+)(.*)/;
my $num = $1;
my $user = $2;
my $company = '?';
if ($user =~ /<(.*@(.*))>/){
if ($map{$1}){
$company = $map{$1};
} elsif ($user =~ /gmail|hotmail|yahoo/){
$company = $user;
} else {
$company = $2;
}
} elsif ($user =~ /<(.*)>/){
$company = $1;
}
my $host = $company;
if ($map{$host}){
$host = $map{$host};
}
if ($map{$host}){
$host = $map{$host};
}
if ($map{$host}){
$host = $map{$host};
}
# print "$num = $user = $host\n";
if ($hosts{$host}){
$hosts{$host} += $num;
} else {
$hosts{$host} = $num;
}
}
foreach my $host (sort keys %hosts) {
printf "%-8d %s\n", $hosts{$host}, $host;
}
# print Dumper(%hosts);