devtools: Auto-set branch to merge to in github-merge#7781
Merged
laanwj merged 1 commit intobitcoin:masterfrom Apr 5, 2016
Merged
devtools: Auto-set branch to merge to in github-merge#7781laanwj merged 1 commit intobitcoin:masterfrom
laanwj merged 1 commit intobitcoin:masterfrom
Conversation
Member
|
Concept ACK; this has been a feature I've wanted for a while. |
Contributor
|
Nice! Concept ACK. |
Member
|
utACK c1cff21 |
contrib/devtools/github-merge.py
Outdated
Member
There was a problem hiding this comment.
Nit: Couldn't this be just one line?
Something like
branch = args.branch or opt_branch or info['base']['ref'] or 'master'
Member
Author
There was a problem hiding this comment.
That's much shorter, also seems to work:
>>> None or 'a' or 'b' or 'c'
'a'
>>> None or None or 'b' or 'c'
'b'
>>> None or None or None or 'c'
'c'
>>> 'f' or None or None or 'c'
'f'
I think the subtle difference in this case is that '' is seen as False (hence the use of is None. But doesn't matter here, an empty branch name is pointless.
As we are already using the API to retrieve the pull request title, also retrieve the base branch. This makes sure that pull requests for 0.12 automatically end up in 0.12, and pull requests for master automatically end up in master, and so on. It is still possible to override the branch from the command line or using the `githubmerge.branch` git option.
c1cff21 to
10d3ae1
Compare
Contributor
|
utACK 10d3ae1 |
Member
Author
|
I've been using this version for a few days, both on master and 0.12, seems to work. |
laanwj
added a commit
that referenced
this pull request
Apr 5, 2016
10d3ae1 devtools: Auto-set branch to merge to in github-merge (Wladimir J. van der Laan)
codablock
pushed a commit
to codablock/dash
that referenced
this pull request
Dec 19, 2017
…erge 10d3ae1 devtools: Auto-set branch to merge to in github-merge (Wladimir J. van der Laan)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As we are already using the API to retrieve the pull request title, also retrieve the base branch.
This makes sure that pull requests for 0.12 automatically end up in 0.12, and pull requests for master automatically end up in master, and so on.
It prints the branch it is about to merge into. It is still possible to override the branch from the command line or using the
githubmerge.branchgit option.