GitHub bridge confuses commits and tags?
Closed this issue · 5 comments
When reading a tag, GitHub seems to return the ID of the tag object. This is not the same as the ID of the commit that has been tagged. This means that e.g. we can't see the CircleCI status of a build (which is presumably recorded against the commit rather than the tag). It also means that git fetch fails. e.g.
> "git" "fetch" "origin" "tags/mac-v1.12.1-beta26.1:git-pull-of-088dbfac25c9291b23340a5d9f88c4a0f19d4251.new"
remote: Counting objects: 303, done.
remote: Compressing objects: 100% (26/26), done.
remote: Total 303 (delta 162), reused 157 (delta 155), pack-reused 121
Receiving objects: 100% (303/303), 3.82 MiB | 841.00 KiB/s, done.
Resolving deltas: 100% (192/192), completed with 74 local objects.
error: cannot update the ref 'refs/heads/git-pull-of-088dbfac25c9291b23340a5d9f88c4a0f19d4251.new': Trying to write non-commit object 088dbfac25c9291b23340a5d9f88c4a0f19d4251 to branch refs/heads/git-pull-of-088dbfac25c9291b23340a5d9f88c4a0f19d4251.new
From github.com:docker/pinata
! [new tag] mac-v1.12.1-beta26.1 -> git-pull-of-088dbfac25c9291b23340a5d9f88c4a0f19d4251.new (unable to update local ref)
* [new tag] mac-v1.12.1-beta26.1 -> mac-v1.12.1-beta26.1
Saw this today, so looks like this isn't fixed:
error: cannot update the ref 'refs/heads/git-pull-of-aac5c4dcbcb2a65de0e845dd429471b5c7892c6e.new': Trying to write non-commit object aac5c4dcbcb2a65de0e845dd429471b5c7892c6e to branch refs/heads/git-pull-of-aac5c4dcbcb2a65de0e845dd429471b5c7892c6e.new
This is working now.
Oops. No it isn't. I just forgot that it might have the commit anyway for some other reason. Here's a failure from today:
[2016-11-02 11:06.42] Fetching PR branch
error: cannot update the ref 'refs/heads/git-pull-of-624daccef414337cc78a7e85c75baf4da26d90e1.new': Trying to write non-commit object 624daccef414337cc78a7e85c75baf4da26d90e1 to branch refs/heads/git-pull-of-624daccef414337cc78a7e85c75baf4da26d90e1.new
what is that .new
suffix?
That's the local name of the branch. We're hoping that some remote branch contains the commit we want, but it might not and it might not be the most recent one. So we fetch to a temporary branch (.new
) and then try to update the real branch to the actual commit we want.