# Pkg add 'at' or 'trackto' / @ or #

**URL:** https://discourse.julialang.org/t/pkg-add-at-or-trackto-or/12270
**Category:** Internals & Design
**Created:** [July 9, 2018, 11:25am UTC](https://discourse.julialang.org/t/pkg-add-at-or-trackto-or/12270 "2018-07-09T11:25:03Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Iagoba\_Apellaniz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/iagoba_apellaniz/32/34406_2.png) [@Iagoba\_Apellaniz](https://discourse.julialang.org/u/Iagoba_Apellaniz)
#### Post date: [July 9, 2018, 11:25am UTC](https://discourse.julialang.org/t/pkg-add-at-or-trackto-or/12270/1 "2018-07-09T11:25:03Z")

</div>

I don’t want to disturb too much for the development of Pkg3. I know you are quite busy.

Nevertheless, I find a bit misleading that `@` is used to pin a tagged commit of the package but a SHA hash cannot be used instead of the tag. [Documentation: Pkg → Adding registered packages](https://docs.julialang.org/en/latest/stdlib/Pkg/#Adding-registered-packages-1).

Indeed one can pin the commit by using `#` which is supposed to track what’s next to it. It makes sense for a branch. Does it make for a commit? Maybe I’m missing something.

Besides, in the documentation seems that using `...@v0.4` and `...@0.4` are equivalents. Are they? Or it is typo? [UPDATE] They are equivalent.

Thanks

---

<div class="post-metadata">

### Author: ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)
#### Post date: [July 9, 2018, 11:39am UTC](https://discourse.julialang.org/t/pkg-add-at-or-trackto-or/12270/2 "2018-07-09T11:39:53Z")

</div>

You mean that e.g.

```julia
(Pkg) pkg> pin JSON#master

```

doesn’t work? Yeah, that’s an oversight. You can do

```julia
pkg> add JSON#master

pkg> pin JSON

```

for now, but it would be good to support the first syntax as well.

---

<div class="post-metadata">

### Author: ![Iagoba\_Apellaniz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/iagoba_apellaniz/32/34406_2.png) [@Iagoba\_Apellaniz](https://discourse.julialang.org/u/Iagoba_Apellaniz)
#### Post date: [July 9, 2018, 11:48am UTC](https://discourse.julialang.org/t/pkg-add-at-or-trackto-or/12270/3 "2018-07-09T11:48:12Z")

</div>

OK. Why I cannot do for instance

```julia
(pkg) pkg> add JSON@f05dd3d26976ae8310cfb512cf0106505e95b51b
# equivalent to
(pkg) pkg> add JSON@v0.17.2 # or JSON@0.17.2 omitting v seems to work

```

Is a bit hard to test the syntax when lots of packages are broken, and everything is under dev.

This way `@` pins the package and `#` tracks it. Sorry if that’s confusing.

---

<div class="post-metadata">

### Author: ![Iagoba\_Apellaniz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/iagoba_apellaniz/32/34406_2.png) [@Iagoba\_Apellaniz](https://discourse.julialang.org/u/Iagoba_Apellaniz)
#### Post date: [July 9, 2018, 11:55am UTC](https://discourse.julialang.org/t/pkg-add-at-or-trackto-or/12270/4 "2018-07-09T11:55:56Z")

</div>

OK I see that @ is to specify only tags… this way is easier for Pkg to handle specific versions instead of downloading the entire repository. Thanks for helping me to understand that.

Could Pkg live with only a single special char such as `@` and check first if some version or tag exists for that and if not clone the repository to see if there is some branch or commit?

```julia
(pkg) pkg> add JSON@master
# check if there is a tag with the name master.... if not behave like JSON#master
(pkg) pkg> add JSON@v0.17.2
# check if there is a tag with the name master.... eureka!!
```

---

<div class="post-metadata">

### Author: ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)
#### Post date: [July 9, 2018, 12:21pm UTC](https://discourse.julialang.org/t/pkg-add-at-or-trackto-or/12270/5 "2018-07-09T12:21:08Z")

</div>

I guess it could work but it would disallow branches with the same name as tags.

---

<div class="post-metadata">

### Author: ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)
#### Post date: [July 9, 2018, 12:33pm UTC](https://discourse.julialang.org/t/pkg-add-at-or-trackto-or/12270/6 "2018-07-09T12:33:18Z")

</div>

Git itself has to disbiguate that anyway so we could just give the same preference. Presumably one must prefer tags over branches.

---

<div class="post-metadata">

### Author: ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)
#### Post date: [July 10, 2018, 1:10pm UTC](https://discourse.julialang.org/t/pkg-add-at-or-trackto-or/12270/7 "2018-07-10T13:10:56Z")

</div>

Opened [https://github.com/JuliaLang/Pkg.jl/issues/487](https://github.com/JuliaLang/Pkg.jl/issues/487).
