-
Notifications
You must be signed in to change notification settings - Fork 38.7k
devtools: Auto-set branch to merge to in github-merge #7781
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Concept ACK; this has been a feature I've wanted for a while. |
|
Nice! Concept ACK. |
|
utACK c1cff21 |
contrib/devtools/github-merge.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Couldn't this be just one line?
Something like
branch = args.branch or opt_branch or info['base']['ref'] or 'master'There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
|
utACK 10d3ae1 |
|
I've been using this version for a few days, both on master and 0.12, seems to work. |
10d3ae1 devtools: Auto-set branch to merge to in github-merge (Wladimir J. van der Laan)
…erge 10d3ae1 devtools: Auto-set branch to merge to in github-merge (Wladimir J. van der Laan)
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.