git integration: Linkify our commits to point to GitLab.
(imported from commit e8d3c107842680dec9bc6aa84f9548c0f879785d)
This commit is contained in:
parent
9f3766dd4a
commit
c2fb80c282
3 changed files with 22 additions and 3 deletions
|
@ -70,11 +70,14 @@ def git_repository_name():
|
|||
|
||||
def git_commit_range(oldrev, newrev):
|
||||
log_cmd = ["git", "log", "--reverse",
|
||||
"--pretty=%aE %s", "%s..%s" % (oldrev, newrev)]
|
||||
"--pretty=%aE %H %s", "%s..%s" % (oldrev, newrev)]
|
||||
commits = ''
|
||||
for ln in subprocess.check_output(log_cmd).splitlines():
|
||||
email, subject = ln.split(None, 1)
|
||||
commits += '!gravatar(%s) %s\n' % (email, subject)
|
||||
author_email, commit_id, subject = ln.split(None, 2)
|
||||
if hasattr(config, "format_commit_message"):
|
||||
commits += config.format_commit_message(author_email, subject, commit_id)
|
||||
else:
|
||||
commits += '!gravatar(%s) %s\n' % (author_email, subject)
|
||||
return commits
|
||||
|
||||
def send_bot_message(oldrev, newrev, refname):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue