Gets rid of the # and @ distinction. Priority is given to versions.
See https://discourse.julialang.org/t/pkg-add-at-or-trackto-or/12270.
It seems like鈥攊n classic git-CLI-"spectacle of inconsistency" fashion鈥攚hen there's a tag and a branch with the same name some git commands prefer the tag while others prefer the branch:
https://softwareengineering.stackexchange.com/questions/230438/in-git-is-it-a-bad-idea-to-create-a-tag-with-the-same-name-as-a-deleted-branch
https://groups.google.com/forum/#!topic/git-users/FfzGmqj6sNQ
So we're free to pick whatever behavior we think is sane here.
It seems kinda annoying to do pkg> add [email protected], there only exists a Foo version 0.6.2 and then get an error message about that the branch 0.6.3 doesn't exist.
FWIW it does not bother me that we have both # and @, you learn it once and then you know what to use.
ASCII syntax is precious though and we may want to hold it in reserve for other future meanings.
One advantage of keeping # rather than @ is that git@gitlab... and similar URLs need less explanation that @ means something else in that context.
Indeed I also prefer the # syntax. For the error message when 0.6.3 tag doesn't exist but 0.6.2 does, the Pkg has to try to search among the branches. Hence, the error could look like: Pkg cannot find any version or branch for Foo with the name 0.6.3. This way the user is aware that Pkg looks for both tags and branches.
I also created a branch using the SHA hash of a commit. It seems that git prefers to switch between branches and not to go to the commit.
IMHO, Pkg should use only a single character, say #, and then look first for TAGs, then for BRANCHes (print a proper error if it does not succeed), and finally for COMMITS (if it is a valid SHA key). Here is a sketch of what can be done. It's only an ides and, for sure that I miss something or I make some mistake :)
(pkg) pkg> add Foo#__key__
|__key__ | empty | is TAG? | is BRANCH? | is COMMIT? |
|---:|---:|---:|---:|---:|
Action | Download released, check for updates as add Foo does. OR print an error saying that key cannot be empty | Download __key__ among releases or TAGs and "pin" it | Clone it, and track for updates nightly. Print Installed and tracking for nightly or something like that | Only if valid SHA Download snapshot and "pin" it |
If It does not succeed tell the user if Pkg has looked at TAGs and BRANCHes, or if it has looked at all possibilities, TAGs, BRANCHes and COMMITs
ERROR: Pkg cannot find any version or branch __key__ for Foo
ERROR: Pkg cannot find any version, branch or commit __key__ for Foo
Let's just keep it the way it is.
Most helpful comment
One advantage of keeping
#rather than@is thatgit@gitlab...and similar URLs need less explanation that@means something else in that context.