Skip to content

Scope a Branch Pattern's Push Operations to the Branches It Can Match in the Write Guard #2964

Closed

Description

@ptr727

Context

Copilot raised this on #2963, the pull request closing #2951. It is an over-denial that change introduced, filed here under that pull request's stop rule rather than chased there, since it trades no safety for the precision it would add.

A Branch Pattern's Operations Reach an Explicitly Named Branch

#2963 reads a lone : refspec, and a branch pattern such as +refs/heads/*:refs/heads/*, as writing every protected default and each branch named beside it, with the pattern's own operations. Git gives an explicitly named refspec precedence over a pattern for a ref both match, so in git push origin '+refs/heads/*:refs/heads/*' feature/y the feature/y update is not forced. The guard reads it as forced, so a non_fast_forward rule on feature/y denies a push git would carry out as an ordinary update or reject on its own. A pattern with a fixed prefix, such as refs/heads/feature/*:refs/heads/feature/*, also reaches the protected defaults it cannot match.

Possible Direction

Pair each pattern's operations with the branches it can match, leaving an explicitly named branch to its own refspec's operations, and skip a protected default a fixed prefix rules out. Any narrowing here removes a deny, so it needs the develop-versus-branch differential the guard's other narrowing changes ran, showing no new allow.

Activity

  1. ptr727 commented on Oct 23, 2026

    @ptr727
    OwnerAuthor

    Closed under the maintainer's decision (ptr727, 2026-10-23) on #3391: the backlog keeps real bugs with a stated failure, features the maintainer wants, and open decisions. A finding the review loop filed on code or text a change did not touch, a refactor or consolidation chore, a tracker, a wording item, or a guard shape no session has produced is closed rather than worked. Reopen with the input and the wrong result if this issue states one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    scriptA defect in hub tooling

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions