Skip to content

Commit ca4c545

Browse files
committed
Merge #10786: Add PR description to merge commit in github-merge.py
475c08c Add PR description to merge commit in github-merge.py (Pieter Wuille) Pull request description: There is often some context given in PR descriptions that is missing from commits, and it may be worthwhile to retain that information in our history in git. This PR adds that information to the merge commit when created through `github-merge.py`. We should also encourage people to provide as much information as possible in the PR commits themselves, but I believe that is an orthogonal issue. Individual commits don't need to have a description of the overall goal of a PR. Tree-SHA512: cbae46ec24ce911744e11a07e5d51895d3acc79659db306d8124304ef8e422bba99001ee2a741b08c92a5eb39d9c3f6b723622b20d6553ca5cfa0a8de866194c
2 parents b27b004 + 475c08c commit ca4c545

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

contrib/devtools/github-merge.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ def main():
175175
if info is None:
176176
exit(1)
177177
title = info['title'].strip()
178+
body = info['body'].strip()
178179
# precedence order for destination branch argument:
179180
# - command line argument
180181
# - githubmerge.branch setting
@@ -229,6 +230,7 @@ def main():
229230
firstline = 'Merge #%s' % (pull,)
230231
message = firstline + '\n\n'
231232
message += subprocess.check_output([GIT,'log','--no-merges','--topo-order','--pretty=format:%h %s (%an)',base_branch+'..'+head_branch]).decode('utf-8')
233+
message += '\n\nPull request description:\n\n ' + body.replace('\n', '\n ') + '\n'
232234
try:
233235
subprocess.check_call([GIT,'merge','-q','--commit','--no-edit','--no-ff','-m',message.encode('utf-8'),head_branch])
234236
except subprocess.CalledProcessError as e:

0 commit comments

Comments
 (0)