# How to properly add releases with PkgDev?

**URL:** https://discourse.julialang.org/t/how-to-properly-add-releases-with-pkgdev/961
**Category:** General Usage
**Tags:** package
**Created:** [December 15, 2016, 12:37am UTC](https://discourse.julialang.org/t/how-to-properly-add-releases-with-pkgdev/961 "2016-12-15T00:37:07Z")
**Posts on this page:** 16
**Page:** 1

<div class="post-metadata">

### Author: ![juliohm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliohm/32/215266_2.png) [@juliohm](https://discourse.julialang.org/u/juliohm)
#### Post date: [December 15, 2016, 12:37am UTC](https://discourse.julialang.org/t/how-to-properly-add-releases-with-pkgdev/961/1 "2016-12-15T00:37:07Z")

</div>

I am probably doing something wrong, but I didn’t find it documented anywhere.

Currently, whenever I need to tag a new release for a package of mine, I do `PkgDev("Foo")`, go to the package directory of (i.e. `~/.julia/v0.5/Foo`), push the tag manually with `git push origin tag_just_created` and open the pull request on the web interface of GitHub in my fork of `METADATA.jl`.

The problem is that, after the pull request is merged, I cannot perform updates with `Pkg.update()`, Julia says there is a divergence in `METADATA.jl` and it cannot fast-forward.

What am I doing wrong and how can I make this process more efficient?

---

<div class="post-metadata">

### Author: ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)
#### Post date: [December 15, 2016, 12:40am UTC](https://discourse.julialang.org/t/how-to-properly-add-releases-with-pkgdev/961/2 "2016-12-15T00:40:56Z")

</div>

This is how I do it:

> [@Problem registering a new package](https://discourse.julialang.org/t/problem-registering-a-new-package/401/2):
>
> I would just use Git directly at this point. The biggest help for me was getting GitKraken to make it easier. For packages, just go in to each directory which is having updating issues and update your master branch to the remote master branch. It may have “gotten stuck” by you updating something, or sometimes the way dependencies are done can cause this. No biggie. For METADATA, these days I just do it by hand because PkgDev.publish() never seems to work. I do the following: Go to the METADA…

You get that METADATA problem when you don’t tag from a different branch. You should always make PRs from the non-master branch (for any repo you work with). If you add to your workflow:

1. Check out a new branch on METADATA
2. Push changes to this branch
3. PR from that branch to JuliaLang/metadata-v2
4. Check out the local metadata-v2 again

you should be fine.

---

<div class="post-metadata">

### Author: ![juliohm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliohm/32/215266_2.png) [@juliohm](https://discourse.julialang.org/u/juliohm)
#### Post date: [December 15, 2016, 12:51am UTC](https://discourse.julialang.org/t/how-to-properly-add-releases-with-pkgdev/961/3 "2016-12-15T00:51:31Z")

</div>

Can we conclude that `PkgDev` is currently causing more harms than benefits?

I was using it in the beginning because it was saving me from this manual process, nowadays with this fast-forward issue, I will adopt your solution and do things manually.

---

<div class="post-metadata">

### Author: ![tbreloff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tbreloff/32/68_2.png) [@tbreloff](https://discourse.julialang.org/u/tbreloff)
#### Post date: [December 15, 2016, 1:33am UTC](https://discourse.julialang.org/t/how-to-properly-add-releases-with-pkgdev/961/4 "2016-12-15T01:33:43Z")

</div>

[Attobot](https://github.com/attobot/attobot) is the way to go now thanks to Simon. It’s **amazing**.

---

<div class="post-metadata">

### Author: ![juliohm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliohm/32/215266_2.png) [@juliohm](https://discourse.julialang.org/u/juliohm)
#### Post date: [December 15, 2016, 1:40am UTC](https://discourse.julialang.org/t/how-to-properly-add-releases-with-pkgdev/961/5 "2016-12-15T01:40:47Z")

</div>

Amazing! Thank you for sharing @tbreloff, I will try to configure it already for my packages.

---

<div class="post-metadata">

### Author: ![tkelman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tkelman/32/692_2.png) [@tkelman](https://discourse.julialang.org/u/tkelman)
#### Post date: [December 15, 2016, 3:10am UTC](https://discourse.julialang.org/t/how-to-properly-add-releases-with-pkgdev/961/6 "2016-12-15T03:10:34Z")

</div>

> [@juliohm](#):
>
> there is a divergence in METADATA.jl and it cannot fast-forward.

Can’t say what might be wrong here without more information. If this happens you should post the output of git status in your local METADATA.

---

<div class="post-metadata">

### Author: ![juliohm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliohm/32/215266_2.png) [@juliohm](https://discourse.julialang.org/u/juliohm)
#### Post date: [December 15, 2016, 9:00am UTC](https://discourse.julialang.org/t/how-to-properly-add-releases-with-pkgdev/961/7 "2016-12-15T09:00:53Z")

</div>

@tkelman the output of `git status` is as follows:

> On branch metadata-v2  
> Your branch and ‘origin/metadata-v2’ have diverged,  
> and have 1 and 1 different commits each, respectively.  
> (use “git pull” to merge the remote branch into yours)  
> nothing to commit, working tree clean

---

<div class="post-metadata">

### Author: ![tkelman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tkelman/32/692_2.png) [@tkelman](https://discourse.julialang.org/u/tkelman)
#### Post date: [December 15, 2016, 10:39am UTC](https://discourse.julialang.org/t/how-to-properly-add-releases-with-pkgdev/961/8 "2016-12-15T10:39:18Z")

</div>

what is the difference between `git log -1` and `git log -1 origin/metadata-v2` then? if there’s nothing to commit and the working tree is clean, seems strange that it couldn’t update. it should have a fallback to `git pull --rebase` if fast forward fails.

---

<div class="post-metadata">

### Author: ![juliohm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliohm/32/215266_2.png) [@juliohm](https://discourse.julialang.org/u/juliohm)
#### Post date: [December 15, 2016, 12:51pm UTC](https://discourse.julialang.org/t/how-to-properly-add-releases-with-pkgdev/961/9 "2016-12-15T12:51:24Z")

</div>

I don’t have it anymore @tkelman, I cleaned everything and will adopt the Attobot approach from now on.

---

<div class="post-metadata">

### Author: ![tkelman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tkelman/32/692_2.png) [@tkelman](https://discourse.julialang.org/u/tkelman)
#### Post date: [December 15, 2016, 12:58pm UTC](https://discourse.julialang.org/t/how-to-properly-add-releases-with-pkgdev/961/10 "2016-12-15T12:58:30Z")

</div>

Wish you had made a copy instead of deleting it entirely. We’ll never fix issues like this if we can’t properly reproduce and debug them.

---

<div class="post-metadata">

### Author: ![juliohm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliohm/32/215266_2.png) [@juliohm](https://discourse.julialang.org/u/juliohm)
#### Post date: [December 15, 2016, 1:12pm UTC](https://discourse.julialang.org/t/how-to-properly-add-releases-with-pkgdev/961/11 "2016-12-15T13:12:47Z")

</div>

I know, I have reported this issue in the past somewhere else, but I don’t remember where and if someone has replied to it at all. The issue should be easily reproduced though.

I am not doing anything more than PkgDev.tag(“Foo”) in a clean `~/.julia/v0.5` directory. After the pull request is merged in METADATA, the fast-forward issue is there in my local machine when I try to `Pkg.update()`.

---

<div class="post-metadata">

### Author: ![simonbyrne](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/simonbyrne/32/19_2.png) [@simonbyrne](https://discourse.julialang.org/u/simonbyrne)
#### Post date: [December 15, 2016, 3:06pm UTC](https://discourse.julialang.org/t/how-to-properly-add-releases-with-pkgdev/961/12 "2016-12-15T15:06:14Z")

</div>

I’ve had similar issues in the past, and I always found myself just deleting the `metadata-v2` branch and starting over by branching it off `origin/metadata-v2` again; after doing this a couple of times I wrote attobot.

I suspect the underlying issue may have something to do with the introduction squash merging in GitHub (as that was roughly when I started noticing it). I haven’t tried it, but I think the following might recreate the problem:

1. user does `Pkg.tag("Foo")`, which creates local METADATA commit on `metadata-v2` branch with hash XXX
2. user runs `Pkg.publish()`: a PR is opened on METADATA.jl
3. PR is squash-merged, commit is changed to hash YYY

- user runs `Pkg.update()` and gets the above error message (as local has commit XXX, and remote has commit YYY)

---

<div class="post-metadata">

### Author: ![juliohm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliohm/32/215266_2.png) [@juliohm](https://discourse.julialang.org/u/juliohm)
#### Post date: [December 15, 2016, 7:51pm UTC](https://discourse.julialang.org/t/how-to-properly-add-releases-with-pkgdev/961/13 "2016-12-15T19:51:16Z")

</div>

@simonbyrne you should post Attobot in the Julia blog, it is such an useful addition to the development workflow!

---

<div class="post-metadata">

### Author: ![tkelman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tkelman/32/692_2.png) [@tkelman](https://discourse.julialang.org/u/tkelman)
#### Post date: [December 16, 2016, 3:42am UTC](https://discourse.julialang.org/t/how-to-properly-add-releases-with-pkgdev/961/14 "2016-12-16T03:42:33Z")

</div>

Does command-line git give an error here if you try `git pull --rebase` in this situation? If not, then the libgit2 implementation that replaced that was flawed and incorrect. I would think git and libgit2 should be able to figure this out - it’s not an exact fast forward but there’s no conflict here.

Kind of a shame since I prefer the cleaner metadata history (one commit for a tag instead of two, the merge commit doesn’t serve much purpose except clutter) when squash merges are used.

---

<div class="post-metadata">

### Author: ![simonbyrne](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/simonbyrne/32/19_2.png) [@simonbyrne](https://discourse.julialang.org/u/simonbyrne)
#### Post date: [December 16, 2016, 10:00am UTC](https://discourse.julialang.org/t/how-to-properly-add-releases-with-pkgdev/961/15 "2016-12-16T10:00:38Z")

</div>

My current METADATA.jl fork is a good example:  
[https://github.com/simonbyrne/METADATA.jl/tree/metadata-v2](https://github.com/simonbyrne/METADATA.jl/tree/metadata-v2)

It differs from origin by one commit, [`671ba7ea4`](https://github.com/simonbyrne/METADATA.jl/commit/671ba7ea4749ad1391955aa238e05b52f930131f), which was squash-merged as [`ec011dda`](https://github.com/JuliaLang/METADATA.jl/commit/ec011dda114abf01d8c63dd71ef6f2b50b2f0c4a).

`git pull --rebase` does work correctly, but `Pkg.update()` just gives:

```julia
julia> Pkg.update()
INFO: Updating METADATA...
WARNING: Cannot perform fast-forward merge.
NFO: Computing changes...
WARNING: ForwardDiff is fixed at 0.2.5+ conflicting with requirement for Optim: [0.3.0,0.4.0)
WARNING: JLD is fixed at 0.6.4+ conflicting with requirement for BenchmarkTools: [0.6.6,∞)
WARNING: Juno is fixed at 0.2.3+ conflicting with requirement for DataFrames: [0.2.4,∞)
WARNING: DiffBase is fixed at 0.0.0- conflicting with requirement for ForwardDiff: [0.0.1,∞)
WARNING: Compat is fixed at 0.9.3+ conflicting with requirement for SHA: [0.9.4,∞)
INFO: No packages to install, update or remove

```

and HEAD remains unchanged.

---

<div class="post-metadata">

### Author: ![simonbyrne](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/simonbyrne/32/19_2.png) [@simonbyrne](https://discourse.julialang.org/u/simonbyrne)
#### Post date: [December 16, 2016, 12:11pm UTC](https://discourse.julialang.org/t/how-to-properly-add-releases-with-pkgdev/961/16 "2016-12-16T12:11:09Z")

</div>

There were some problems in how we were calling libgit2. I’ve put together a fix that should hopefully fix it ([Fixes broken LibGit2.rebase! by simonbyrne · Pull Request #19624 · JuliaLang/julia · GitHub](https://github.com/JuliaLang/julia/pull/19624)).
