Skip to content

fix(release): an exported GIT_DIR never redirects the release command's push and fetch #1397

Closed as not planned

Description

@dan-petty

Problem

#1124 runs the release command's remote git calls (the release-branch fetch, the cut push and the tag push, through _run_remote_git_or_exit in src/devops_cli/commands/release.py) with the person's environment, so their configured credential helper answers. That environment also carries git's own location variables. An exported GIT_DIR, GIT_WORK_TREE, GIT_INDEX_FILE or GIT_NAMESPACE points those calls at another repository, while the cut's other git calls, which run in the sanitized environment, use --root.

Acceptance criteria

  • build_subprocess_env (src/devops_cli/core/process.py) can drop git's own location variables, the list git rev-parse --local-env-vars prints, from an inherited environment. The release command's remote git calls use it, so GIT_DIR and its siblings never redirect them, while the credential helper and SSH_AUTH_SOCK still reach git.
  • A real-git test exports GIT_DIR pointing at a second repository and shows the release push and fetch still act on the --root repository.
  • Tests are offline (local bare remotes), each call phase stays under 1 s, and uv run devops ci passes; changelog.d/<n>.md records the change.

Strategic alignment


Found on 2026-10-08 while delivering #1124. Filed directly with no priority; the roadmap service's intake sets Priority, Value and Effort.

Activity

  1. added
    type/bug
    scope/release
    source/agent
    on Oct 8, 2026
  2. dan-petty-bot commented on Oct 8, 2026

    @dan-petty-bot
    Collaborator

    Intake placed this item to the backlog: at intake only a critical fix goes into a release; a release start pulls Ready items in, P0 features first.

    • Priority: P2-Medium. It can push or fetch against the wrong repository, but only when the user has a git location variable exported, a non-default but realistic condition.
    • Value: Medium. Affects users with bare-repo dotfiles or linked worktrees who export GIT_DIR, and the failure mode (wrong-repo push) is severe when it occurs.
    • Effort: Medium. Requires extending build_subprocess_env to strip the list from 'git rev-parse --local-env-vars', wiring it into the release remote-git calls, and adding a real-git test with a second bare remote.
  3. dan-petty commented on Oct 22, 2026

    @dan-petty
    OwnerAuthor

    Superseded by ADR 0012 (docs/adr/0012-releases-are-derived-by-release-please-from-trunk-and-milestones-are-planning-buckets.md). The cut, the fragments or the hand-built release pull request that this issue concerns are deleted by the new release model.

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

    scope/releasesource/agenttype/bug

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions