Skip to content

Commit 067fba5

Browse files
committed
devtools: Always use unabbreviated commit IDs in github-merge.py
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.
1 parent 8a503a6 commit 067fba5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

contrib/devtools/github-merge.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@
3232
# OS specific configuration for terminal attributes
3333
ATTR_RESET = ''
3434
ATTR_PR = ''
35-
COMMIT_FORMAT = '%h %s (%an)%d'
35+
COMMIT_FORMAT = '%H %s (%an)%d'
3636
if os.name == 'posix': # if posix, assume we can use basic terminal escapes
3737
ATTR_RESET = '\033[0m'
3838
ATTR_PR = '\033[1;36m'
39-
COMMIT_FORMAT = '%C(bold blue)%h%Creset %s %C(cyan)(%an)%Creset%C(green)%d%Creset'
39+
COMMIT_FORMAT = '%C(bold blue)%H%Creset %s %C(cyan)(%an)%Creset%C(green)%d%Creset'
4040

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

0 commit comments

Comments
 (0)