forge: name the credential helper the way git resolves it
/etc/gitconfig shipped `helper = git-credential-hive-forge`. git prepends
`git-credential-` to any helper value that is not an absolute path, so
that resolves to `git-credential-git-credential-hive-forge`, which does
not exist -- no helper runs at all. The sibling github.nix has always used
the short form.
Measured rather than read off the docs, with the arms isolated from the
personal ~/.gitconfig:
helper = git-credential-hive-forge -> 0 credentials, and git prints
"'credential-git-credential-hive-forge' is not a git command"
helper = hive-forge -> 1 credential, clean stderr
The reason this survived: every long-lived agent has a personal
~/.gitconfig naming the helper by ABSOLUTE path, which git accepts, so
pushes keep working and the stderr line reads as noise. The system config
is masked exactly where someone would notice it and bites a fresh agent
that has no such file.
This commit is contained in:
parent
922f91cb7d
commit
8b845896e2
1 changed files with 12 additions and 1 deletions
|
|
@ -124,10 +124,21 @@ in
|
|||
# by eval with both modules defining it, not assumed: a silent last-wins
|
||||
# here would drop one integration's credentials and look exactly like this
|
||||
# bug again.
|
||||
|
||||
# ⚠️ `hive-forge`, NOT `git-credential-hive-forge`: git prepends
|
||||
# `git-credential-` to a helper value that is not an absolute path, so
|
||||
# the longer spelling resolves to `git-credential-git-credential-hive-
|
||||
# forge` and NO helper runs. `./github.nix` always had the short form.
|
||||
#
|
||||
# The failure is quiet, which is why it survived: git prints the
|
||||
# unresolved name to stderr and returns no credential, but a push still
|
||||
# works for any agent whose personal `~/.gitconfig` names the helper by
|
||||
# ABSOLUTE path — so this is masked exactly where it would be noticed,
|
||||
# and bites a fresh agent that has no such file.
|
||||
environment.etc."gitconfig" = lib.mkIf (config.hyperhive.forge.url != null) {
|
||||
text = ''
|
||||
[credential "${lib.removeSuffix "/" config.hyperhive.forge.url}"]
|
||||
helper = git-credential-hive-forge
|
||||
helper = hive-forge
|
||||
username = ${userName}
|
||||
'';
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue