Conversation
libgit2 is not capable of using git-credentials helpers yet. This prevents private repositories from being used. Based on code that was replaced in NixOS#9240 (Introduce libgit2); hence: Co-authored-by: Eelco Dolstra <edolstra@gmail.com>
| if (git_remote_fetch(remote.get(), &refspecs2, &opts, nullptr)) | ||
| throw Error("fetching '%s' from '%s': %s", refspec, url, git_error_last()->message); | ||
| runProgram(RunOptions { | ||
| .program = "git", |
There was a problem hiding this comment.
- Tracking git command dependency blockers in Remove runtime dependency on
gitpackage #9807
It shouldn't be an issue to add it back. The only problem was, that in order to reliably fetch shallowly nix would have to ignore any Another problem to fix: never share the same cache between shallow and non-shallow clones of the same repo, otherwise we will trip into certain issues which computing revCounts etc. Other than that I don't see any blockers. It should be easy to enable it. |
thufschmitt
left a comment
There was a problem hiding this comment.
It's quite sad that we can't have that on top of libgit2. But Fixing the bug is the priority here, so 👍
|
I opened a separate PR with the shallow changes, just in case you want to deal with it separately: #9811 |
|
The PR title "Fix git auth" is a bit misleading when what it actually does is "reintroduce the Rather than rip out the libgit code entirely, I would have preferred an |
... is a bit misleading, because that dependency was never removed. This topic can be discussed constructively at #9807.
I did consider this, but I removed it because it would bitrot.
This increases the maintenance burden, and requires that we always ask in bug reports whether the user's Nix uses the git CLI or not, which is a non-obvious question, and in some cases hard to answer. We could try engineer the error messages for this, but I'd rather solve a domain problem than spend resources on such extrinsic complexity. However, even then, it is not a complete solution because of the other work on #9807. I'd suggest to work on more relevant problems. |
Motivation
Private repos should work, as they did.
Done
Follow-up:
Context
Thank you @DavHau for helping with the tests
I've looked at reimplementing the git credentials protocol, but I'm not eager to maintain a custom, security sensitive component in a place where it won't find contributors. That, and we have more important things to do!
Priorities and Process
Add 👍 to pull requests you find important.
The Nix maintainer team uses a GitHub project board to schedule and track reviews.