Pkg.jl
Pkg.jl copied to clipboard
Pkg.add() and `add` slightly different results
Sorry if this a FAQ - are Pkg.add()
and add
do different things?
Here, Pkg.add()
adds a "#master" at the end, whereas add
doesn't.
(@MiniFB) pkg> add https://github.com/oheil/Luxor.jl#multi_drawing
Updating git-repo `https://github.com/oheil/Luxor.jl`
Resolving package versions...
Updating `~/.julia/environments/MiniFB/Project.toml`
[ae8d54c2] ~ Luxor v3.5.0 `https://github.com/oheil/Luxor.jl#multi_drawing#master` ⇒ v3.5.0 `https://github.com/oheil/Luxor.jl#multi_drawing`
Updating `~/.julia/environments/MiniFB/Manifest.toml`
🔴 [ae8d54c2] ~ Luxor v3.5.0 `https://github.com/oheil/Luxor.jl#multi_drawing#master` ⇒ v3.5.0 `https://github.com/oheil/Luxor.jl#multi_drawing`
Precompiling project...
✓ Luxor
1 dependency successfully precompiled in 4 seconds. 82 already precompiled.
1 dependency precompiled but a different version is currently loaded. Restart julia to access the new version
(@MiniFB) pkg> st
Status `~/.julia/environments/MiniFB/Project.toml`
[5ae59095] Colors v0.12.8
[ae8d54c2] Luxor v3.5.0 `https://github.com/oheil/Luxor.jl#multi_drawing`
[cc649173] MiniFB v0.1.1
julia> Pkg.add(path="https://github.com/oheil/Luxor.jl#multi_drawing")
Updating git-repo `https://github.com/oheil/Luxor.jl#multi_drawing`
Resolving package versions...
Updating `~/.julia/environments/MiniFB/Project.toml`
[ae8d54c2] ~ Luxor v3.5.0 `https://github.com/oheil/Luxor.jl#multi_drawing` ⇒ v3.5.0 `https://github.com/oheil/Luxor.jl#multi_drawing#master`
Updating `~/.julia/environments/MiniFB/Manifest.toml`
🔴 [ae8d54c2] ~ Luxor v3.5.0 `https://github.com/oheil/Luxor.jl#multi_drawing` ⇒ v3.5.0 `https://github.com/oheil/Luxor.jl#multi_drawing#master`
Precompiling project...
✓ Luxor
1 dependency successfully precompiled in 3 seconds. 82 already precompiled.
1 dependency precompiled but a different version is currently loaded. Restart julia to access the new version
(@MiniFB) pkg> st
Status `~/.julia/environments/MiniFB/Project.toml`
[5ae59095] Colors v0.12.8
[ae8d54c2] Luxor v3.5.0 `https://github.com/oheil/Luxor.jl#multi_drawing#master`
[cc649173] MiniFB v0.1.1
Pkg.add(path="https://github.com/oheil/Luxor.jl#multi_drawing")
This is spelled Pkg.add(url = "https://github.com/oheil/Luxor.jl", rev = "multi_drawing")
. It is at least hinted to here: https://pkgdocs.julialang.org/v1/api/#Package-API-Reference. The Pkg REPL is meant for interactive use, so it tries to be a bit more "clever" compared to the API, which you have to tell exactly what you mean.
Ah, OK, thanks! I was just automating some manual typing, and translated it carelessly... Feel free to close this if you want.
Perhaps Pkg.add(path="https://github.com/oheil/Luxor.jl#multi_drawing")
should error instead of just ignoring part of the (malformed) input?
Problem is that it is a a valid URL though.
Edit: Although from Wikipedia:
[...] Clients are not supposed to send URI fragments to servers when they retrieve a document [...]
curl
drops it silently, git
errors.