Skip to content

acq: opt-in --inherit-git-identity to carry host git identity into the sandbox (env-injection) #214

Open

Description

@wz-gsa

Summary

Opt-in convenience (deferred from the git-identity classifier work, approved via consensus vote): let a user inherit their host global git identity into the sandbox without weakening isolation.

Background

The sandbox home is isolated — the host ~/.gitconfig is deliberately NOT mounted — so git identity only crosses the boundary via repo-local config. That's correct for isolation, but a user with many sub-repos must set user.email per repo. An opt-in inheritance mechanism would reduce that friction.

Proposed (env-injection only — the vetted approach)

Add an opt-in flag (e.g. acq run --inherit-git-identity) that reads the host's git config --global user.name / user.email and injects them as GIT_AUTHOR_NAME/GIT_AUTHOR_EMAIL + GIT_COMMITTER_NAME/GIT_COMMITTER_EMAIL into the sandbox environment.

  • Only two scalar strings cross the boundary — no config-surface leak.
  • Off by default (adopting host identity inside an isolation sandbox is itself a mild surprise).
  • Authorship only — it does NOT configure signing; SSH signing still uses the forwarded agent key.

Explicitly rejected (consensus vote)

  • Mounting ~/.gitconfig — leaks credential helpers, insteadOf URL rewrites, and signing-key paths across the boundary (security surface). Also references host key files that aren't mounted → breakage.
  • Auto-writing repo-local config — mutates the user's repos and leaves state behind after the sandbox is gone (surprising, and doesn't know which of many sub-repos to touch).

Status

Deferred as YAGNI until requested — the classifier fix (this PR's sibling) already gives accurate per-repo guidance. Filing so it's tracked, not forgotten.

Activity

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

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions