From 4c098c8509d7f1ed7f4e870ca12f1f4c87d84fc8 Mon Sep 17 00:00:00 2001 From: "rsesek@chromium.org" Date: Thu, 7 Jan 2010 01:56:26 +0000 Subject: [PATCH] When running git presubmit hooks, use the changelist's description, rather than the local commit message's. BUG=31695 TEST=git cl upload where commit message is missing BUG= but CL description has one. No presubmit error. Review URL: http://codereview.chromium.org/523101 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@35682 0039d316-1c4b-4281-b951-d872f2087c98 --- git_cl_hooks.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/git_cl_hooks.py b/git_cl_hooks.py index cdb1c35d0..d2f876027 100644 --- a/git_cl_hooks.py +++ b/git_cl_hooks.py @@ -9,6 +9,7 @@ import sys import breakpad +import gcl import presubmit_support import scm import watchlists @@ -39,9 +40,12 @@ class ChangeOptions: if not m: raise Exception("Could not parse log message: %s" % log) name = m.group(1) - description = m.group(2) files = scm.GIT.CaptureStatus([root], upstream_branch) issue = Backquote(['git', 'cl', 'status', '--field=id']) + if issue == "None": + description = m.group(2) + else: + description = gcl.GetIssueDescription(int(issue)) patchset = None self.change = presubmit_support.GitChange(name, description, absroot, files, issue, patchset)