mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-26 19:48:56 +00:00
Merge pull request #311 from fidencio/topic/count-committers-from-all-the-branches
elections: Go through project branches
This commit is contained in:
commit
6f46be3f2e
@ -108,52 +108,53 @@ for repo in org.repositories():
|
|||||||
(repo, start_time, end_time))
|
(repo, start_time, end_time))
|
||||||
|
|
||||||
authors = AuthorSet()
|
authors = AuthorSet()
|
||||||
for commit in repo.commits(since=start_time, until=end_time,
|
for branch in repo.branches():
|
||||||
number=number):
|
for commit in repo.commits(sha=branch.name, since=start_time, until=end_time,
|
||||||
if commit.author is None:
|
number=number):
|
||||||
if commit.commit.author is None:
|
|
||||||
print('Skipping %s in %s as it has no author. Did this merge via GitHub?' %
|
|
||||||
(commit, repo))
|
|
||||||
continue
|
|
||||||
|
|
||||||
author_id = commit.commit.author.get('email')
|
|
||||||
print('%s in %s as has no author. Using email (%s) as the author id' %
|
|
||||||
(commit, repo, author_id))
|
|
||||||
else:
|
|
||||||
author_id = commit.author.login
|
|
||||||
|
|
||||||
if author_id not in author_cache:
|
|
||||||
if commit.author is None:
|
if commit.author is None:
|
||||||
author = Author(author_id, email=author_id,
|
if commit.commit.author is None:
|
||||||
name=commit.commit.author.get('name'))
|
print('Skipping %s in %s as it has no author. Did this merge via GitHub?' %
|
||||||
|
(commit, repo))
|
||||||
|
continue
|
||||||
|
|
||||||
|
author_id = commit.commit.author.get('email')
|
||||||
|
print('%s in %s as has no author. Using email (%s) as the author id' %
|
||||||
|
(commit, repo, author_id))
|
||||||
else:
|
else:
|
||||||
_author = gh.user(commit.author.login)
|
author_id = commit.author.login
|
||||||
author = Author(_author.login, email=_author.email,
|
|
||||||
name=_author.name)
|
|
||||||
|
|
||||||
author_cache[author_id] = author
|
if author_id not in author_cache:
|
||||||
|
if commit.author is None:
|
||||||
|
author = Author(author_id, email=author_id,
|
||||||
|
name=commit.commit.author.get('name'))
|
||||||
|
else:
|
||||||
|
_author = gh.user(commit.author.login)
|
||||||
|
author = Author(_author.login, email=_author.email,
|
||||||
|
name=_author.name)
|
||||||
|
|
||||||
author = author_cache[author_id]
|
author_cache[author_id] = author
|
||||||
author.commit_count += 1
|
|
||||||
|
|
||||||
# If the GitHub account doesn't have a name or email address
|
author = author_cache[author_id]
|
||||||
# the author *may* have included it in their git config.
|
author.commit_count += 1
|
||||||
if author.email is None and commit.commit.author.get('email'):
|
|
||||||
author.email = commit.commit.author.get('email')
|
|
||||||
if author.name is None and commit.commit.author.get('name'):
|
|
||||||
author.name = commit.commit.author.get('name')
|
|
||||||
|
|
||||||
# last ditch effort did the author use a valid email address in the
|
# If the GitHub account doesn't have a name or email address
|
||||||
# DCO line?
|
# the author *may* have included it in their git config.
|
||||||
match = dco_re.search(commit.message)
|
if author.email is None and commit.commit.author.get('email'):
|
||||||
if match:
|
author.email = commit.commit.author.get('email')
|
||||||
if ((author.email is None or
|
if author.name is None and commit.commit.author.get('name'):
|
||||||
'users.noreply.github.com' in author.email) and
|
author.name = commit.commit.author.get('name')
|
||||||
match.group('email')):
|
|
||||||
author.email = match.group('email')
|
# last ditch effort did the author use a valid email address in the
|
||||||
if author.name is None and match.group('name'):
|
# DCO line?
|
||||||
author.name = match.group('name')
|
match = dco_re.search(commit.message)
|
||||||
authors.add(author)
|
if match:
|
||||||
|
if ((author.email is None or
|
||||||
|
'users.noreply.github.com' in author.email) and
|
||||||
|
match.group('email')):
|
||||||
|
author.email = match.group('email')
|
||||||
|
if author.name is None and match.group('name'):
|
||||||
|
author.name = match.group('name')
|
||||||
|
authors.add(author)
|
||||||
projects.append({str(repo): authors})
|
projects.append({str(repo): authors})
|
||||||
|
|
||||||
# Dark YAML voodoo
|
# Dark YAML voodoo
|
||||||
|
Loading…
Reference in New Issue
Block a user