devtools: Auto-set branch to merge to in github-merge #7781

pull laanwj wants to merge 1 commits into bitcoin:master from laanwj:2016_04_github_merge_autobranch changing 1 files +22 −12
  1. laanwj commented at 12:39 PM on April 1, 2016: member

    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.branch git option.

  2. laanwj added the label Dev Scripts on Apr 1, 2016
  3. sipa commented at 12:43 PM on April 1, 2016: member

    Concept ACK; this has been a feature I've wanted for a while.

  4. jonasschnelli commented at 3:17 PM on April 1, 2016: contributor

    Nice! Concept ACK. Great safety measure also.

  5. MarcoFalke commented at 4:29 PM on April 1, 2016: member

    utACK c1cff21

  6. devtools: Auto-set branch to merge to in github-merge
    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.
    10d3ae102a
  7. in contrib/devtools/github-merge.py:None in c1cff212f3 outdated
     120 | +    #   - base branch for pull (as retrieved from github)
     121 | +    #   - 'master'
     122 |      branch = args.branch
     123 | +    branch = opt_branch if branch is None else branch
     124 | +    branch = info['base']['ref'] if branch is None else branch
     125 | +    branch = 'master' if branch is None else branch
    


    MarcoFalke commented at 4:33 PM on April 1, 2016:

    Nit: Couldn't this be just one line?

    Something like

    branch = args.branch or opt_branch or info['base']['ref'] or 'master'
    

    laanwj commented at 5:22 AM on April 2, 2016:

    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.

  8. laanwj force-pushed on Apr 2, 2016
  9. btcdrak commented at 9:38 AM on April 5, 2016: contributor

    utACK 10d3ae1

  10. laanwj commented at 1:41 PM on April 5, 2016: member

    I've been using this version for a few days, both on master and 0.12, seems to work. Tested ACK 10d3ae1

  11. laanwj merged this on Apr 5, 2016
  12. laanwj closed this on Apr 5, 2016

  13. laanwj referenced this in commit 55db5f07b1 on Apr 5, 2016
  14. codablock referenced this in commit 6b5bb3a266 on Sep 16, 2017
  15. codablock referenced this in commit ab8b81c08d on Sep 19, 2017
  16. codablock referenced this in commit da90f538a9 on Dec 9, 2017
  17. codablock referenced this in commit 6da749e358 on Dec 19, 2017
  18. codablock referenced this in commit 1cd653cc54 on Dec 19, 2017
  19. DrahtBot locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 15:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me