fix: wire credential helper automatically in git-remote-did#167
Merged
LiranCohen merged 2 commits intomainfrom Mar 3, 2026
Merged
fix: wire credential helper automatically in git-remote-did#167LiranCohen merged 2 commits intomainfrom
LiranCohen merged 2 commits intomainfrom
Conversation
git-remote-did spawns `git remote-http` but never told git which credential helper to use. Git fell back to an interactive username/ password prompt that can't work for DID auth. Now injects `-c credential.helper=git-remote-did-credential` and `-c credential.useHttpPath=true` when spawning the child process. Push auth works out of the box — no `gitd setup` required. Also makes the credential helper fail loudly instead of silently returning nothing when it can't authenticate (no daemon, no password, missing path). Users now see actionable error messages with hints.
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.
Summary
git-remote-didnow injects-c credential.helper=git-remote-did-credentialand-c credential.useHttpPath=truewhen spawninggit remote-http, so push auth works out of the box withoutgitd setupgit-remote-did-credentialnow fails loudly with actionable hints instead of silently returning nothing when auth can't proceed (no daemon, no password, missing path)Problem
git pushto a DID remote promptedUsername for 'http://localhost:9418':and failed withfatal: Authentication failed. The credential helper was never invoked becausegit-remote-diddidn't tell git about it.Root cause
git-remote-didresolves the DID to an HTTP URL and spawnsgit remote-http, but passed no credential configuration. Git had no way to know aboutgit-remote-did-credentialunless the user had previously rungitd setup(which setscredential.helperglobally). Without that, git fell back to interactive prompts.Build, test, lint
All pass: 1119 tests, 0 failures, 0 lint warnings.