Pkg.jl: Pinning a pinned package should error instead of be a no-op

Created on 20 Aug 2018  Â·  4Comments  Â·  Source: JuliaLang/Pkg.jl

(v1.1) pkg> st
    Status `~/.julia/environments/v1.1/Project.toml`
  [7876af07] Example v0.5.1

(v1.1) pkg> pin [email protected]
 Resolving package versions...
  Updating `~/.julia/environments/v1.1/Project.toml`
  [7876af07] ↓ Example v0.5.1 ⇒ v0.4.1 ⚲
  Updating `~/.julia/environments/v1.1/Manifest.toml`
  [7876af07] ↓ Example v0.5.1 ⇒ v0.4.1 ⚲
[...]

(v1.1) pkg> pin [email protected]                               <-- This should error ?
 Resolving package versions...
  Updating `~/.julia/environments/v1.1/Project.toml`
 [no changes]
  Updating `~/.julia/environments/v1.1/Manifest.toml`
 [no changes]

Most helpful comment

I vote for an informative warning. If that is insufficient, possibly introduce a --force option to pin?

All 4 comments

Or maybe actually pin to the new version, would mean that pin implicitly frees though.

The two sensible behaviors would seem to be:

  1. Tell you that it's already pinned and that you have to free and then pin again.
  2. Do that for you automatically with a warning.

I vote for an informative warning. If that is insufficient, possibly introduce a --force option to pin?

pin should also not work on packages which have already been deved. It doesn't make sense to pin something which is already considered fixed.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

omus picture omus  Â·  4Comments

moustachio-belvedere picture moustachio-belvedere  Â·  3Comments

GordStephen picture GordStephen  Â·  3Comments

KristofferC picture KristofferC  Â·  4Comments

StefanKarpinski picture StefanKarpinski  Â·  3Comments