Protected branches #6697

issue dcousens opened this issue on September 19, 2015
  1. dcousens commented at 12:50 AM on September 19, 2015: contributor
  2. dexX7 commented at 9:19 AM on September 19, 2015: contributor

    That's a really cool feature!

    After a (legit) forced push, there is even a hint:

    remember

    And once the guard is enabled, it's visible to anyone:

    lock

    This is the message returned, when trying to force a push to a locked branch:

    /tmp/protected-branch-test$ git push origin master -f
    Counting objects: 1, done.
    Writing objects: 100% (1/1), 205 bytes | 0 bytes/s, done.
    Total 1 (delta 0), reused 0 (delta 0)
    remote: error: GH006: Protected branch update failed for refs/heads/master.
    remote: error: Cannot force-push to a protected branch
    To https://github.com/dexX7/protected-branch-test.git
     ! [remote rejected] master -> master (protected branch hook declined)
    error: failed to push some refs to 'https://github.com/dexX7/protected-branch-test.git'
    

    And if the CI tests fail, merges via git web, or command-line are blocked as expected.

    I tested it with the github-merge.sh script:

    Type 'push' to push the result to git@github.com:dexX7/protected-branch-test, branch master. push
    Counting objects: 1, done.
    Writing objects: 100% (1/1), 910 bytes | 0 bytes/s, done.
    Total 1 (delta 0), reused 0 (delta 0)
    remote: error: GH006: Protected branch update failed for refs/heads/master.
    remote: error: Required status check "continuous-integration/travis-ci" is failing
    To git@github.com:dexX7/protected-branch-test
     ! [remote rejected] master -> master (protected branch hook declined)
    error: failed to push some refs to 'git@github.com:dexX7/protected-branch-test'
    

    The guard can be disabled at any time.

  3. laanwj commented at 8:01 PM on September 22, 2015: member

    Ok, tried enabling this for all branches.

  4. laanwj closed this on Sep 22, 2015

  5. dcousens commented at 10:06 PM on September 22, 2015: contributor

    @laanwj awesome! Out of interest, did you just stop force pushing or did you enable status checking also?

    all the boxes

  6. gmaxwell commented at 10:49 PM on September 22, 2015: contributor

    We do not use github infrastructure for merging as it is incompatible with digital signatures (for the obvious reasons.)

  7. laanwj commented at 4:44 PM on September 23, 2015: member

    I only blocked force-pushing for now. I'm not convinced that making status checks mandatory will work with our custom merge script, as @gmaxwell says.

  8. dcousens commented at 6:26 PM on September 23, 2015: contributor

    @laanwj :+1:

  9. MarcoFalke 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-30 00:15 UTC

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