macOS/Linux: bundle Git Credential Manager - #6
Merged
Conversation
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/.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bundles the pinned official GCM release in the macOS and Linux dists so
credential.helper = managerworks 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 inbuild-temp/), extracts to<dest>/gcm/, and installs a two-line sh shim atlibexec/git-core/git-credential-manager. git prependsGIT_EXEC_PATHto 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.dllwhen 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 createsetc/gitconfigon macOS/Linux (the RUNTIME_PREFIX build reads it relative to the extracted tree; previously the function warned and baked nothing there). Bakescredential.helper = manager, the AzureuseHttpPathkey, and thefilter.lfsblock MinGit already carries on Windows. Linux additionally getscredential.credentialStore = secretservice(GCM has no default store on Linux;GCM_CREDENTIAL_STOREoverrides). Windows keys/cleanup unchanged..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'sentitlements.xml) — CoreCLR crashes at startup without them.git-credential-wincredMinGit leaves inlibexec/git-core/(thebin/copy was already removed).Verified
Ran
bundle_gcm+patch_git_configagainst the real extractedgit-macos-arm64tree (v2.54.0.anchorpoint.3), on Apple Silicon:git config --system --listfrom the bundled git shows the baked keys (helper, azure, lfs filter).git credential-manager --version→2.8.0+d5e8a344…— resolved through git's exec-path dispatch, shim exec'd the real .NET binary.gcm/, zero.dlls; the two apphosts get the entitlements, the git-core shim does not.secretservicekey 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