Skip to content

macOS/Linux: bundle Git Credential Manager - #6

Merged
jochenhz merged 1 commit into
mainfrom
ap2-144-bundle-gcm
Jul 14, 2026
Merged

macOS/Linux: bundle Git Credential Manager#6
jochenhz merged 1 commit into
mainfrom
ap2-144-bundle-gcm

Conversation

@jochenhz

Copy link
Copy Markdown
Contributor

Bundles the pinned official GCM release in the macOS and Linux dists so credential.helper = manager works everywhere — previously only the Windows MinGit dist shipped GCM, leaving the from-source dists with no credential helper at all (no OAuth sign-in, no keychain storage for HTTPS remotes).

Tracked as AP2-144.

What

  • bundle_gcm() — downloads the pinned GCM tarball (GCM_VERSION/GCM_SHA256, cached in build-temp/), extracts to <dest>/gcm/, and installs a two-line sh shim at libexec/git-core/git-credential-manager. git prepends GIT_EXEC_PATH to a helper's PATH, so the shim resolves exactly like the bundled git-lfs. A shim rather than a symlink because the .NET apphost misresolves its app .dll when the executable path is a symlink; rather than moving files because the macOS tarball is a ~200-file .NET layout that must stay next to its apphost.
  • patch_git_config() — now creates etc/gitconfig on macOS/Linux (the RUNTIME_PREFIX build reads it relative to the extracted tree; previously the function warned and baked nothing there). Bakes credential.helper = manager, the Azure useHttpPath key, and the filter.lfs block MinGit already carries on Windows. Linux additionally gets credential.credentialStore = secretservice (GCM has no default store on Linux; GCM_CREDENTIAL_STORE overrides). Windows keys/cleanup unchanged.
  • Signing — GCM's Mach-O files (two apphosts + native dylibs) are re-signed via an explicit allowlist; the ~200 .NET .dlls carry the executable bit but are PE files codesign rejects. The main executables keep GCM's hardened-runtime JIT entitlements (gcm-entitlements.plist, mirrors upstream's entitlements.xml) — CoreCLR crashes at startup without them.
  • Prunes the legacy git-credential-wincred MinGit leaves in libexec/git-core/ (the bin/ copy was already removed).
  • README: GCM + the missing Linux asset row / host-setup / publish notes.

Verified

Ran bundle_gcm + patch_git_config against the real extracted git-macos-arm64 tree (v2.54.0.anchorpoint.3), on Apple Silicon:

  • git config --system --list from the bundled git shows the baked keys (helper, azure, lfs filter).
  • git credential-manager --version2.8.0+d5e8a344… — resolved through git's exec-path dispatch, shim exec'd the real .NET binary.
  • Codesign target selection: 18 Mach-O files in gcm/, zero .dlls; the two apphosts get the entitlements, the git-core shim does not.
  • Linux branch exercised with platform faked: extraction, shim, and secretservice key verified (binary itself can't run on macOS).

Not yet verified (needs a signed release cut): notarization of a signed macOS package, and a real OAuth round-trip in the app — release + consumer lock bump are the follow-up in AP2-144.

Size

macOS +42 MB compressed (~110 MB on disk), Linux +38 MB (~90 MB) — GCM off-Windows carries its own .NET runtime + Avalonia UI; the Windows MinGit GCM stays the ~600 KB .NET-Framework flavor.

🤖 Generated with Claude Code

https://claude.ai/code/session_01TieqcqJQBp3UKVSjCSUhjP

The from-source dists shipped no credential helper at all -- GCM only
reached Windows via MinGit -- so HTTPS remotes had no OAuth sign-in or
keychain storage. Bundle the pinned official GCM release under gcm/
(sha256-verified download, cached in build-temp/), shim it into
libexec/git-core/ so GIT_EXEC_PATH resolves it like the bundled git-lfs,
and create etc/gitconfig (read via RUNTIME_PREFIX) wiring
credential.helper=manager plus the lfs filter block; Linux defaults the
store to secretservice. Re-signing keeps GCM's hardened-runtime JIT
entitlements (gcm-entitlements.plist) -- CoreCLR crashes at startup
without them. Also prune the legacy wincred helper MinGit leaves in
libexec/git-core/.
@jochenhz
jochenhz merged commit 494d947 into main Jul 14, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant