Skip to content

Read a Persisted remote.<name>.mirror on a Bare Push in the Write Guard #3020

Closed

Description

@ptr727

Context

Found by the local review of the change closing #3007. Develop's guard shares it. #2943 lists persisted push.default=matching and remote.origin.push among the config a bare push does not consult, and this is a third such key, not named there.

A Persisted remote.<name>.mirror Makes a Bare Push a Mirror

With remote.origin.mirror=true set by an earlier command or session, a bare git push or git push origin force-updates and prunes every ref, exactly as --mirror does. A dry run in a throwaway repository confirmed it deletes a remote develop that has no local counterpart. The guard reads such a push as a bare push of the current branch only, so it allows it from a feature branch where develop's rules hold deletion or non_fast_forward.

Possible Direction

Read remote.<name>.mirror for the remote a bare push or a refspec-less push names. Where it is true, read the push as --mirror, a force and a delete against every protected default. Where the config cannot be read, fail closed on the protected defaults.

Activity

  1. added
    script
    on Oct 14, 2026
  2. ptr727 commented on Oct 15, 2026

    @ptr727
    OwnerAuthor

    Claimed for an engineering-track lane (handoff #3040 resume). Branch: feature/guard-bare-push-target-3019. Predicted file set: host-setup/agent-safety/claude/gh-write-guard.py, host-setup/agent-safety/claude/test_install.py, host-setup/agent-safety/README.md, host-setup/agent-safety/claude/README.md.

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

    script

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions