Skip to content

Commit

Permalink
devtools: Always use unabbreviated commit IDs in github-merge.py
Browse files Browse the repository at this point in the history
Always put the unabbreviated commit IDs in the generated commit messages
and other places. This prevents the developer's `core.abbrev` git setting
from leaking through and is better against ambiguity too.

Github-Pull: bitcoin#16201
Rebased-From: 067fba5
  • Loading branch information
laanwj authored and fanquake committed Jul 7, 2019
1 parent d1a09cf commit ed218a2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions contrib/devtools/github-merge.py
Expand Up @@ -32,11 +32,11 @@
# OS specific configuration for terminal attributes
ATTR_RESET = ''
ATTR_PR = ''
COMMIT_FORMAT = '%h %s (%an)%d'
COMMIT_FORMAT = '%H %s (%an)%d'
if os.name == 'posix': # if posix, assume we can use basic terminal escapes
ATTR_RESET = '\033[0m'
ATTR_PR = '\033[1;36m'
COMMIT_FORMAT = '%C(bold blue)%h%Creset %s %C(cyan)(%an)%Creset%C(green)%d%Creset'
COMMIT_FORMAT = '%C(bold blue)%H%Creset %s %C(cyan)(%an)%Creset%C(green)%d%Creset'

def git_config_get(option, default=None):
'''
Expand Down Expand Up @@ -279,7 +279,7 @@ def main():
else:
firstline = 'Merge #%s' % (pull,)
message = firstline + '\n\n'
message += subprocess.check_output([GIT,'log','--no-merges','--topo-order','--pretty=format:%h %s (%an)',base_branch+'..'+head_branch]).decode('utf-8')
message += subprocess.check_output([GIT,'log','--no-merges','--topo-order','--pretty=format:%H %s (%an)',base_branch+'..'+head_branch]).decode('utf-8')
message += '\n\nPull request description:\n\n ' + body.replace('\n', '\n ') + '\n'
message += get_acks_from_comments(head_commit=subprocess.check_output([GIT,'log','-1','--pretty=format:%H',head_branch]).decode('utf-8')[:6], comments=comments)
try:
Expand Down

0 comments on commit ed218a2

Please sign in to comment.