-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve error message when unable to initialize git index repo #9869
Conversation
With this - it'll be more obvious which git repo couldn't be initialized.
(rust-highfive has picked a reviewer for you, use r? to override) |
@bors: r+ Thanks! I'm a bit uncertain on whether this closes the issue, but I'm ok doing that for now. I think that Cargo relies on enough git things that it wouldn't be great to ignore the errors here and I'm hoping that it's something that's either easily fixable in the gitconfig itself or is something that can be fixed in libgit2. |
📌 Commit 168fac4 has been approved by |
The specific gitconfig issue (incorrectly assuming it's malformed) #9853 should be fixed - via a fix to libgit2 However, I don't think #9854 can be fixed - it's asking for cargo to work despite a malformed gitconfig. AFAICT cargo can't initialize the registry in this kind of case and has to fail. This is my understanding - what do you think? |
I think it sort of depends on the error. While giving a better error is certainly better than the status quo I also don't think that this is something that users should be running into regularly. For example I wouldn't want to hide bugs in libgit2 but if users frequently hit the same bug in libgit2 then that helps us prioritize fixing it and/or reporting it upstream. Basically this shouldn't happen, but there's no way really to predict why it will happen to preemptively cover it up. There may be some situations though where it's reasonable to ignore the global config, but I don't know them off the top of my head, so just having a better error for now I think is fine. |
☀️ Test successful - checks-actions |
Update cargo 6 commits in 18751dd3f238d94d384a7fe967abfac06cbfe0b9..e515c3277bf0681bfc79a9e763861bfe26bb05db 2021-09-01 14:26:00 +0000 to 2021-09-08 14:32:15 +0000 - Remove log output that may leak tokens (rust-lang/cargo#9873) - rev = "refs/pull/𑑛/head" (rust-lang/cargo#9859) - Update suggestion message on bad project name error (rust-lang/cargo#9877) - clarify what goes into "*-sys" crates (rust-lang/cargo#9871) - Improve error message when unable to initialize git index repo (rust-lang/cargo#9869) - Use serde_json to generate cargo_vcs_info.json (rust-lang/cargo#9865)
Update cargo 6 commits in 18751dd3f238d94d384a7fe967abfac06cbfe0b9..e515c3277bf0681bfc79a9e763861bfe26bb05db 2021-09-01 14:26:00 +0000 to 2021-09-08 14:32:15 +0000 - Remove log output that may leak tokens (rust-lang/cargo#9873) - rev = "refs/pull/𑑛/head" (rust-lang/cargo#9859) - Update suggestion message on bad project name error (rust-lang/cargo#9877) - clarify what goes into "*-sys" crates (rust-lang/cargo#9871) - Improve error message when unable to initialize git index repo (rust-lang/cargo#9869) - Use serde_json to generate cargo_vcs_info.json (rust-lang/cargo#9865)
With this - it'll be more obvious which git repo
couldn't be initialized.
Looks like this
Does the best we can with #9854 - since I don't think it can actually be fixed.
Fixes #9854