`jh git-credential setup` writes `https://*.juliahub.com`, which Julia's LibGit2 cannot parse, breaking Pkg git fetches
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 70/100
Research direction
Start in git.go at gitCredentialSetup() and inspect how entries from juliaHubDomains and configServer are written. Reproduce the failure with LibGit2.ismatch and the wildcard configuration, then verify that the generated credential configuration no longer causes Julia Pkg git fetches to fail.
Written by the indexing model from the issue text.
Description
Not really a jh bug. The config jh writes is valid git; Julia just can't read it. I'm filing it here because the practical fix is easiest on this side.
What happens
jh git-credential setup (gitCredentialSetup() in git.go) writes a credential helper for each entry in juliaHubDomains, including a wildcard host:
[credential "https://*.juliahub.com"]
helper = /home/<user>/.local/bin/jh git-credential
Git supports this: gitcredentials(7) allows "wildcards in the domain name … as with the http.<URL>.* options". Julia's LibGit2 stdlib does not. When Pkg fetches any git remote over https, LibGit2 walks every credential.<url>.helper in the config and runs each URL through LibGit2.ismatch, which throws on the * host:
ERROR: Unable to parse URL
[1] error(s::String)
[2] ismatch(url::SubString{String}, git_cred::LibGit2.GitCredential) @ LibGit2/src/gitcredential.jl:65
[3] credential_helpers(cfg::LibGit2.GitConfig, cred::LibGit2.GitCredential)
...
[22] update(regs::Vector{Pkg.Registry.RegistrySpec}; ...) @ Pkg/src/Registry/Registry.jl:425
The fetch that fails doesn't need to involve JuliaHub. Here it was a github.com git registry (DyadHVACRegistry) during Pkg.add, so any Pkg.add, Pkg.update or registry update over git breaks. In my case it stopped the Pluto server in the Pluto VS Code extension from starting at all.
Reproduction
With the wildcard entry in ~/.gitconfig (Julia 1.12.6; master has the same code):
using LibGit2
LibGit2.ismatch("https://juliahub.com", LibGit2.GitCredential("https", "github.com", "x.git")) # fine
LibGit2.ismatch("https://*.juliahub.com", LibGit2.GitCredential("https", "github.com", "x.git")) # ERROR: Unable to parse URL
Commenting out just the *.juliahub.com section makes Pkg work again. The juliahub.com and internal.juliahub.com entries parse fine.
Suggestion
Since jh's users are mostly Julia users, one of:
- Write explicit hosts instead of the wildcard:
juliahub.complus the configured server (the code already appendsconfigServer) and any known subdomains. This is the smallest change and works with every Julia version. - Keep the wildcard behind an opt-in (e.g.
--wildcard), and warn that Julia's Pkg can't read it. - At minimum, document the conflict and the workarounds: remove the wildcard line, or set
JULIA_PKG_USE_CLI_GIT=trueso Pkg uses the git CLI, which understands the wildcard.
The underlying LibGit2 behaviour belongs upstream in JuliaLang/julia. There is no existing issue for it; a report is being prepared and I'll link it here. Fixing it there only helps new Julia releases, which is why (1) is still worth doing.
Seen with jh 0.3.0; the wildcard is still in git.go on main (v0.4.0).
🤖 Posted for @pankgeorg by an AI agent — harness: Claude Code 2.1.283 · model: claude-opus-5-5
Session: local Claude Code session d41c35d3-a593-490a-ada2-8549b2045452
- Dominant language
- Go
- Stars
- 3
- Forks
- 1
- Avg merge
- 4d 5h
- Merged PRs (30d)
- 3
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from JuliaComputing/jh
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
JuliaComputing/jh#60 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 30/100
JuliaComputing/jh#10 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 52/100
JuliaComputing/jh#9 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 30/100
JuliaComputing/jh#3 ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
JuliaComputing/jh#1 · 1 comment ·
All issues in JuliaComputing/jh
Similar issues
-
bug needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
netdata/netdata#24062 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
meshery/meshery#22119 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
automation documentation
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day