Skip to content

Judge a Push to Another Remote Against That Remote's Repository in the Write Guard #3048

Closed

Description

@ptr727

Context

Found while closing the #2943 item about the directory a push runs in. Develop's guard shares it.

A Push to Another Remote Is Judged Against the Origin's Rules

_check_push_bypass reads branch rules from the checkout's origin remote, whatever remote the push names. With a second remote upstream pointing at another repository, git push upstream develop is judged against the origin's develop. Where the origin's develop carries no pull_request rule and the other repository's does, the guard allows the push.

The same holds for a push naming a URL or a path instead of a remote, and for a bare push whose branch pushes to a pushRemote or remote.pushDefault other than origin.

Possible Direction

Resolve the remote each push names, or the one a bare push uses, to its URL, and read the rules of the repository that URL names as well as the origin's. Where the remote cannot be resolved to a repository, treat its rules as undetermined, which denies only a protected default.

Activity

  1. added
    bug
    pre-existing
    script
    on Oct 15, 2026
  2. ptr727 commented on Oct 21, 2026

    @ptr727
    OwnerAuthor

    Claimed for an engineering-track lane (handoff #3312 resume). Branch: feature/guard-push-targets-3048. Predicted file set: all of host-setup/agent-safety/, READMEs included, with the edits expected in host-setup/agent-safety/claude/gh-write-guard.py, host-setup/agent-safety/claude/test_install.py, host-setup/agent-safety/README.md, and host-setup/agent-safety/claude/README.md. This claim covers #3048, #3053, and #2943's push-target items (persisted push config, the repository a -C/cd/sudo -D push runs in, a pattern-matched branch under a non-default ruleset, and cd -/cd ~-).

  3. added a commit that references this issue on Oct 22, 2026
    96f571a
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

    bugpre-existingscript

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions