Revert "Show commit message, not PR title, for PR pushes"
This reverts commit 24df8c996e
.
This commit is contained in:
parent
1926aafacb
commit
13f7ae682c
1 changed files with 3 additions and 8 deletions
|
@ -175,9 +175,6 @@ class GitHub(object):
|
||||||
def _flat_unique(self, commits, key):
|
def _flat_unique(self, commits, key):
|
||||||
return set(itertools.chain(*(commit[key] for commit in commits)))
|
return set(itertools.chain(*(commit[key] for commit in commits)))
|
||||||
|
|
||||||
def _commit_message(self, message):
|
|
||||||
return message.split("\n")[0].strip()
|
|
||||||
|
|
||||||
def push(self, full_name, data):
|
def push(self, full_name, data):
|
||||||
outputs = []
|
outputs = []
|
||||||
branch = data["ref"].split("/", 2)[2]
|
branch = data["ref"].split("/", 2)[2]
|
||||||
|
@ -195,7 +192,7 @@ class GitHub(object):
|
||||||
for commit in data["commits"]:
|
for commit in data["commits"]:
|
||||||
hash = commit["id"]
|
hash = commit["id"]
|
||||||
hash_colored = utils.irc.color(self._short_hash(hash), colors.COLOR_ID)
|
hash_colored = utils.irc.color(self._short_hash(hash), colors.COLOR_ID)
|
||||||
message = self._commit_message(commit["message"])
|
message = commit["message"].split("\n")[0].strip()
|
||||||
url = self._short_url(COMMIT_URL % (full_name, hash))
|
url = self._short_url(COMMIT_URL % (full_name, hash))
|
||||||
|
|
||||||
outputs.append(
|
outputs.append(
|
||||||
|
@ -228,8 +225,6 @@ class GitHub(object):
|
||||||
branch = data["pull_request"]["base"]["ref"]
|
branch = data["pull_request"]["base"]["ref"]
|
||||||
colored_branch = utils.irc.color(branch, colors.COLOR_BRANCH)
|
colored_branch = utils.irc.color(branch, colors.COLOR_BRANCH)
|
||||||
|
|
||||||
title = data["pull_request"]["title"]
|
|
||||||
|
|
||||||
if action == "opened":
|
if action == "opened":
|
||||||
action_desc = "requested %s merge into %s" % (number,
|
action_desc = "requested %s merge into %s" % (number,
|
||||||
colored_branch)
|
colored_branch)
|
||||||
|
@ -245,12 +240,12 @@ class GitHub(object):
|
||||||
action_desc = "marked %s ready for review" % number
|
action_desc = "marked %s ready for review" % number
|
||||||
elif action == "synchronize":
|
elif action == "synchronize":
|
||||||
action_desc = "committed to %s" % number
|
action_desc = "committed to %s" % number
|
||||||
title = self._commit_message(data["commit"]["message"])
|
|
||||||
|
|
||||||
|
pr_title = data["pull_request"]["title"]
|
||||||
author = utils.irc.bold(data["sender"]["login"])
|
author = utils.irc.bold(data["sender"]["login"])
|
||||||
url = self._short_url(data["pull_request"]["html_url"])
|
url = self._short_url(data["pull_request"]["html_url"])
|
||||||
return ["[PR] %s %s: %s - %s" % (
|
return ["[PR] %s %s: %s - %s" % (
|
||||||
author, action_desc, title, url)]
|
author, action_desc, pr_title, url)]
|
||||||
|
|
||||||
def pull_request_review(self, full_name, data):
|
def pull_request_review(self, full_name, data):
|
||||||
if not data["action"] == "submitted":
|
if not data["action"] == "submitted":
|
||||||
|
|
Loading…
Reference in a new issue