aboutsummaryrefslogtreecommitdiff
path: root/contrib/devtools/github-merge.py
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2016-01-25 14:58:02 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2016-01-25 14:58:21 +0100
commit0893705ebfa66c4997838734208ebf44a773eed7 (patch)
tree32ce7cf55eecbc829024745d596b5fc92a5e72ba /contrib/devtools/github-merge.py
parent9f796f3d2b53dee0425aeede1e71d1e7add93a03 (diff)
parent17b5d3896f2cd189b1a4665956bdfba368d46f0e (diff)
Merge #7395: devtools: show pull and commit information in github-merge
17b5d38 devtools: show pull and commit information in github-merge (Wladimir J. van der Laan)
Diffstat (limited to 'contrib/devtools/github-merge.py')
-rwxr-xr-xcontrib/devtools/github-merge.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/contrib/devtools/github-merge.py b/contrib/devtools/github-merge.py
index 33d33b7005..6854ecb073 100755
--- a/contrib/devtools/github-merge.py
+++ b/contrib/devtools/github-merge.py
@@ -24,6 +24,15 @@ import subprocess
GIT = os.getenv('GIT','git')
BASH = os.getenv('BASH','bash')
+# OS specific configuration for terminal attributes
+ATTR_RESET = ''
+ATTR_PR = ''
+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'
+
def git_config_get(option, default=None):
'''
Get named configuration option from git repository.
@@ -150,6 +159,9 @@ def main():
print("ERROR: Creating merge failed (already merged?).",file=stderr)
exit(4)
+ print('%s#%s%s %s' % (ATTR_RESET+ATTR_PR,pull,ATTR_RESET,title))
+ subprocess.check_call([GIT,'log','--graph','--topo-order','--pretty=format:'+COMMIT_FORMAT,base_branch+'..'+head_branch])
+ print()
# Run test command if configured.
if testcmd:
# Go up to the repository's root.