Skip to content

use of hashtag # in branch name fails #3157

@filchristou

Description

@filchristou

Probably not the best practice but ]add of branches with "#" in the name throws an error:

E.g. let's say I want to add the branch rem_vertexSAFE#33 from https://github.com/filchristou/MetaGraphsNext.jl.git

# clean environment.
(mgn_my) pkg> add https://github.com/filchristou/MetaGraphsNext.jl.git#rem_vertexSAFE#33
ERROR: Package name/uuid must precede revision specifier `#33`.

Bypassing it with quotes will work but with undesirable behavior

(mgn_my) pkg> add "https://github.com/filchristou/MetaGraphsNext.jl.git#rem_vertexSAFE#33"

The manifest then will be:

[[deps.MetaGraphsNext]]
deps = ["Graphs", "JLD2"]
git-tree-sha1 = "6f3371197acf57728e3d27e0b3f113824f808c95"
repo-rev = "master"
repo-url = "https://github.com/filchristou/MetaGraphsNext.jl.git#rem_vertexSAFE#33"
uuid = "fa8bd995-216d-47f1-8a91-f3b68fbeb377"
version = "0.3.0"

, which is not the desired behavior.

Finally one can get the job done with:

julia> Pkg.add(url="https://github.com/filchristou/MetaGraphsNext.jl.git", rev="rem_vertexSAFE#33")

and get the correct branch in Manifest:

[[deps.MetaGraphsNext]]
deps = ["Graphs", "JLD2"]
git-tree-sha1 = "adbbf17dd8bbfed46830f12694981df2e041a190"
repo-rev = "rem_vertexSAFE#33"
repo-url = "https://github.com/filchristou/MetaGraphsNext.jl.git"
uuid = "fa8bd995-216d-47f1-8a91-f3b68fbeb377"
version = "0.3.0"

Although the last command works, the first 2 attempts are more popular and should be consistent with each other.
I would at least expect an informative error.

Julia Version 1.7.3
Commit 742b9abb4d (2022-05-06 12:58 UTC)
Platform Info:
OS: Linux (x86_64-pc-linux-gnu)
CPU: Intel(R) Core(TM) i7-7500U CPU @ 2.70GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-12.0.1 (ORCJIT, skylake)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions