diff --git a/git_cl.py b/git_cl.py index f3aa2ab5ae..8cc37bf589 100755 --- a/git_cl.py +++ b/git_cl.py @@ -2764,7 +2764,8 @@ def PatchIssue(issue_arg, reject, nocommit, directory, auth_config): # If we had an issue, commit the current state and register the issue. if not nocommit: - RunGit(['commit', '-m', ('patch from issue %(i)s at patchset ' + RunGit(['commit', '-m', (cl.GetDescription() + '\n\n' + + 'patch from issue %(i)s at patchset ' '%(p)s (http://crrev.com/%(i)s#ps%(p)s)' % {'i': issue, 'p': patchset})]) cl = Changelist(auth_config=auth_config) diff --git a/tests/git_cl_test.py b/tests/git_cl_test.py index bb963c76a0..54878ebf3c 100755 --- a/tests/git_cl_test.py +++ b/tests/git_cl_test.py @@ -878,6 +878,7 @@ class TestGitCl(TestCase): def _patch_common(self): self.mock(git_cl.Changelist, 'GetMostRecentPatchset', lambda x: '60001') self.mock(git_cl.Changelist, 'GetPatchSetDiff', lambda *args: None) + self.mock(git_cl.Changelist, 'GetDescription', lambda *args: 'Description') self.mock(git_cl.Changelist, 'SetIssue', lambda *args: None) self.mock(git_cl.Changelist, 'SetPatchset', lambda *args: None) self.mock(git_cl, 'IsGitVersionAtLeast', lambda *args: True) @@ -894,6 +895,7 @@ class TestGitCl(TestCase): self.calls += [ ((['git', 'apply', '--index', '-p0', '--3way'],), ''), ((['git', 'commit', '-m', + 'Description\n\n' + 'patch from issue 123456 at patchset 60001 ' + '(http://crrev.com/123456#ps60001)'],), ''), ]