aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2017-09-05 14:51:21 -0700
committerMarcoFalke <falke.marco@gmail.com>2017-09-05 14:51:26 -0700
commit777519bd96f68c18150a0f5942f8f97a91937f5e (patch)
treed9544fa7230bb8feabf4e9991f6856b004bea0aa
parent4eb1f39d421024d9666cec61deaf96715ffae4c6 (diff)
parentdabee00ef1a7a2857c3318e898d3f63f79853048 (diff)
downloadbitcoin-777519bd96f68c18150a0f5942f8f97a91937f5e.tar.xz
Merge #11246: github-merge: Coalesce git fetches
dabee00ef github-merge: Coalesce git fetches (Wladimir J. van der Laan) Pull request description: Fetch the destination branch as well as PR in one go. Saves a few seconds (as well as one ssh authentication, when using a yubikey) when using github-merge.py. Tree-SHA512: 618fcc07f60b63de3b7818094c5a307933324b76418aa02c509209bb7b540b3da0abe312bbfd0ca843469ed82228b2c43c2361180ba81bee13038aafac4a14b3
-rwxr-xr-xcontrib/devtools/github-merge.py10
1 files changed, 3 insertions, 7 deletions
diff --git a/contrib/devtools/github-merge.py b/contrib/devtools/github-merge.py
index 4b1bae6100..2941d2cb6d 100755
--- a/contrib/devtools/github-merge.py
+++ b/contrib/devtools/github-merge.py
@@ -197,9 +197,10 @@ def main():
print("ERROR: Cannot check out branch %s." % (branch), file=stderr)
sys.exit(3)
try:
- subprocess.check_call([GIT,'fetch','-q',host_repo,'+refs/pull/'+pull+'/*:refs/heads/pull/'+pull+'/*'])
+ subprocess.check_call([GIT,'fetch','-q',host_repo,'+refs/pull/'+pull+'/*:refs/heads/pull/'+pull+'/*',
+ '+refs/heads/'+branch+':refs/heads/'+base_branch])
except subprocess.CalledProcessError as e:
- print("ERROR: Cannot find pull request #%s on %s." % (pull,host_repo), file=stderr)
+ print("ERROR: Cannot find pull request #%s or branch %s on %s." % (pull,branch,host_repo), file=stderr)
sys.exit(3)
try:
subprocess.check_call([GIT,'log','-q','-1','refs/heads/'+head_branch], stdout=devnull, stderr=stdout)
@@ -211,11 +212,6 @@ def main():
except subprocess.CalledProcessError as e:
print("ERROR: Cannot find merge of pull request #%s on %s." % (pull,host_repo), file=stderr)
sys.exit(3)
- try:
- subprocess.check_call([GIT,'fetch','-q',host_repo,'+refs/heads/'+branch+':refs/heads/'+base_branch])
- except subprocess.CalledProcessError as e:
- print("ERROR: Cannot find branch %s on %s." % (branch,host_repo), file=stderr)
- sys.exit(3)
subprocess.check_call([GIT,'checkout','-q',base_branch])
subprocess.call([GIT,'branch','-q','-D',local_merge_branch], stderr=devnull)
subprocess.check_call([GIT,'checkout','-q','-b',local_merge_branch])