hub checkout on remotes affected by old version of hub

Created on 30 Mar 2018  ·  14Comments  ·  Source: github/hub

Having this the first time - could check out a lot of PRs with hub:

⋊> ~/g/w/app on master ⨯ hub checkout https://github.com/walleth/walleth/pull/235
fatal: Cannot setup tracking information; starting point 'friedger/87/upgrade2' is not a branch.
⋊> ~/g/w/app on master ⨯ hub --version                                                                  20:29:58
git version 2.15.1
hub version 2.3.0-pre10
bug

Most helpful comment

Just wanted to say simply deleting the remote (git remote rm REMOTE_NAME) fixed it for me; when you run hub checkout PR again, it will recreate the remote.

All 14 comments

Thank you for reporting. I cannot reproduce this issue. Are you still getting this? Is it just for this repo/PR or does it affect every repo/PR?

$ HUB_VERBOSE=1 hub checkout https://github.com/walleth/walleth/pull/235
$ git config --get-all hub.host
> GET https://api.github.com/repos/walleth/walleth/pulls/235
> Authorization: token [REDACTED]
> Accept: application/vnd.github.v3+json;charset=utf-8
< HTTP 200
$ git rev-parse -q --git-dir
$ git remote -v
$ git config hub.protocol
$ git fetch origin refs/pull/235/head:friedger-87/upgrade2
From https://github.com/walleth/walleth
 * [new ref]         refs/pull/235/head -> friedger-87/upgrade2
$ git config branch.friedger-87/upgrade2.remote https://github.com/friedger/walleth.git
$ git config branch.friedger-87/upgrade2.merge refs/heads/87/upgrade2
$ git checkout friedger-87/upgrade2
Switched to branch 'friedger-87/upgrade2'

it was working afterwards for the above PR - but just had this with another PR:

hub checkout https://github.com/ligi/PassAndroid/pull/193
remote: Counting objects: 17, done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 17 (delta 7), reused 17 (delta 7), pack-reused 0
Unpacking objects: 100% (17/17), done.
From git://github.com/simontb/PassAndroid
 * [new branch]        close_nav_drawer_onBackPress -> simontb/close_nav_drawer_onBackPress
fatal: Cannot setup tracking information; starting point 'simontb/close_nav_drawer_onBackPress' is not a branch.

Perhaps this is an issue that something needs to be propagated to all servers first?! Let me know if there is more information I can provide.

@ligi Perhaps this is something about your git configuration? Can you take a look at git config -l --show-origin in your repo and paste us relevant information that might affect branches and tracking information (please scrub any personal/sensitive configuration).

Are you saying that this only happens once per PR, and then deleting the checked out branch name and trying to repeat the hub checkout command works without an error?

If you find this to be reproducable, you can use HUB_VERBOSE=1 env variable to enable debugging mode and get more information about where this might be failing.

Are you saying that this only happens once per PR, and then deleting the checked out branch name and trying to repeat the hub checkout command works without an error?

no - I could repeat the checkout command and got the same error multiple times - the error was gone trying days later

If you find this to be reproducable, you can use HUB_VERBOSE=1 env variable to enable debugging mode and get more information about where this might be failing.

I will do next time this happens - currently all PRs where this happened are merged

Please let us know if this is still an issue. Otherwise I might close this since I can't really reproduce this and we haven't gotten similar reports. 🙇

I got the same error while trying to checkout PR. Here is the verbose output:

➜  alpakka git:(master) ✗ env HUB_VERBOSE=1 hub co https://github.com/akka/alpakka/pull/1022
$ git config alias.co
$ git help -a
$ git config --get-all hub.host
> GET https://api.github.com/repos/akka/alpakka/pulls/1022
> Authorization: token [REDACTED]
> Accept: application/vnd.github.v3+json;charset=utf-8
< HTTP 200
{"url": ...
$ git rev-parse -q --git-dir
$ git remote -v
$ git rev-parse -q --git-path refs/heads/ennru_jms-samples-java
$ git fetch ennru +refs/heads/ennru_jms-samples-java:refs/remotes/ennru/ennru_jms-samples-java
$ git checkout -b ennru_jms-samples-java --track ennru/ennru_jms-samples-java
fatal: Cannot setup tracking information; starting point 'ennru/ennru_jms-samples-java' is not a branch.

And here is a relevant excerpt from the gitconfig of this clone:

➜  alpakka git:(master) ✗ git config -l --show-origin | grep ennru
file:.git/config        [email protected]:ennru/alpakka.git
file:.git/config        remote.ennru.fetch=+refs/heads/ennru_csv-sample-java:refs/remotes/ennru/ennru_csv-sample-java
file:.git/config        remote.ennru.tagopt=--no-tags
file:.git/config        remote.ennru.fetch=+refs/heads/ennru_csv-sample-java:refs/remotes/ennru/ennru_csv-sample-java
file:.git/config        branch.ennru-ennru_csv-sample-java.remote=ennru
file:.git/config        branch.ennru-ennru_csv-sample-java.merge=refs/heads/ennru_csv-sample-java

Note that if I try to run hub co on a clean clone of alpakka then it all works. Here is the output of the same config command of a fresh clone where the command succeeded:

➜  alpakka-test git:(ennru_jms-samples-java) git config -l --show-origin | grep ennru
file:.git/config        [email protected]:ennru/alpakka.git
file:.git/config        branch.ennru_jms-samples-java.merge=refs/heads/ennru_jms-samples-java

I've just started receiving the same error:

~/p/tridactyl (master|✔) $ env HUB_VERBOSE=1 hub checkout https://github.com/cmcaine/tridactyl/pull/758
$ git config --get-all hub.host
> GET https://api.github.com/repos/cmcaine/tridactyl/pulls/758
> Authorization: token [REDACTED]
> Accept: application/vnd.github.v3+json;charset=utf-8
< HTTP 200
{"url": ...
$ git rev-parse -q --git-dir
$ git remote -v
$ git rev-parse -q --git-path refs/heads/enhance_tabopen_container_completion
$ git fetch glacambre +refs/heads/enhance_tabopen_container_completion:refs/remotes/glacambre/enhance_tabopen_container_completion
$ git checkout -b enhance_tabopen_container_completion --track glacambre/enhance_tabopen_container_completion
fatal: Cannot setup tracking information; starting point 'glacambre/enhance_tabopen_container_completion' is not a branch.
~/p/tridactyl (master|●5) $ hub --version
git version 2.18.0
hub version 2.4.0

I still get this error reproducibly on multiple machines. It seems to be related to the user whose PR I am checking out. On the Tridactyl repo I can check out peff's, ELLIOTCABLE's, Susexe's, IsaacKhor's PRs but I get the same error above for all of glacambre's, gsbabil's, and antonva's commits. The pattern seems to be that the most prolific contributors are the ones whose PRs I cannot check out.

Here's my output of git config -l --show-origin:

file:/home/olie/.gitconfig  user.name=Oliver Blanthorn
file:/home/olie/.gitconfig  user.signingkey=Blanthorn
file:/home/olie/.gitconfig  push.default=simple
file:/home/olie/.gitconfig  push.followtags=true
file:/home/olie/.gitconfig  core.editor=vim
file:/home/olie/.gitconfig  color.status=auto
file:/home/olie/.gitconfig  color.branch=auto
file:/home/olie/.gitconfig  color.interactive=auto
file:/home/olie/.gitconfig  color.diff=auto
file:/home/olie/.gitconfig  color.ui=auto
file:/home/olie/.gitconfig  core.excludesfile=~/.gitignore
file:/home/olie/.gitconfig  diff.tool=icdiff
file:/home/olie/.gitconfig  difftool.prompt=false
file:/home/olie/.gitconfig  difftool.icdiff.cmd=icdiff --line-numbers $LOCAL $REMOTE
file:/home/olie/.gitconfig  log.decorate=auto
file:/home/olie/.gitconfig  log.date=relative
file:/home/olie/.gitconfig  log.graph=true
file:/home/olie/.gitconfig  merge.tool=vimdiff
file:/home/olie/.gitconfig  merge.conflictstyle=diff3
file:/home/olie/.gitconfig  merge.prompt=false
file:/home/olie/.gitconfig  alias.nicelog=log --graph --abbrev-commit --stat
file:/home/olie/.gitconfig  alias.loggraph=log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(auto)%d%C(reset)'
file:/home/olie/.gitconfig  alias.lg2-specific=log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(auto)%d%C(reset)%n''          %C(white)%s%C(reset) %C(dim white)- %an%C(reset)'
file:/home/olie/.gitconfig  alias.lg3-specific=log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset) %C(bold cyan)(committed: %cD)%C(reset) %C(auto)%d%C(reset)%n''          %C(white)%s%C(reset)%n''          %C(dim white)- %an <%ae> %C(reset) %C(dim white)(committer: %cn <%ce>)%C(reset)'
file:/home/olie/.gitconfig  alias.innit=init
file:/home/olie/.gitconfig  commit.gpgsign=true
file:/home/olie/.gitconfig  [email protected]:.pushinsteadof=https://github.com/
file:/home/olie/.gitconfig  [email protected]:.pushinsteadof=git://github.com/
file:.git/config    core.repositoryformatversion=0
file:.git/config    core.filemode=true
file:.git/config    core.bare=false
file:.git/config    core.logallrefupdates=true
file:.git/config    [email protected]:cmcaine/tridactyl.git
file:.git/config    remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
file:.git/config    branch.master.remote=origin
file:.git/config    branch.master.merge=refs/heads/master
file:.git/config    branch.configSquished.remote=origin
file:.git/config    branch.configSquished.merge=refs/heads/configSquished
file:.git/config    branch.sourceRC.remote=origin
file:.git/config    branch.sourceRC.merge=refs/heads/sourceRC
file:.git/config    remote.larsks.url=git://github.com/larsks/tridactyl.git
file:.git/config    remote.larsks.fetch=+refs/heads/bug/mkstemp-fd-leak:refs/remotes/larsks/bug/mkstemp-fd-leak
file:.git/config    remote.larsks.tagopt=--no-tags
file:.git/config    branch.larsks-bug/mkstemp-fd-leak.remote=larsks
file:.git/config    branch.larsks-bug/mkstemp-fd-leak.merge=refs/heads/bug/mkstemp-fd-leak
file:.git/config    branch.haveyougotaflag.remote=origin
file:.git/config    branch.haveyougotaflag.merge=refs/heads/haveyougotaflag
file:.git/config    branch.configdocs.remote=origin
file:.git/config    branch.configdocs.merge=refs/heads/configdocs
file:.git/config    remote.antonva.url=git://github.com/antonva/tridactyl.git
file:.git/config    remote.antonva.fetch=+refs/heads/containers:refs/remotes/antonva/containers
file:.git/config    remote.antonva.tagopt=--no-tags
file:.git/config    remote.antonva.fetch=+refs/heads/containers:refs/remotes/antonva/containers
file:.git/config    branch.antonva-containers.remote=antonva
file:.git/config    branch.antonva-containers.merge=refs/heads/containers
file:.git/config    remote.glacambre.url=git://github.com/glacambre/tridactyl.git
file:.git/config    remote.glacambre.fetch=+refs/heads/implement_restart:refs/remotes/glacambre/implement_restart
file:.git/config    remote.glacambre.tagopt=--no-tags
file:.git/config    remote.glacambre.fetch=+refs/heads/implement_tristart_autocmd:refs/remotes/glacambre/implement_tristart_autocmd
file:.git/config    remote.glacambre.fetch=+refs/heads/read_about_config:refs/remotes/glacambre/read_about_config
file:.git/config    remote.glacambre.fetch=+refs/heads/read_about_config:refs/remotes/glacambre/read_about_config
file:.git/config    remote.glacambre.fetch=+refs/heads/js_pipes:refs/remotes/glacambre/js_pipes
file:.git/config    remote.glacambre.fetch=+refs/heads/impl_jumplist:refs/remotes/glacambre/impl_jumplist
file:.git/config    remote.glacambre.fetch=+refs/heads/smoothscroll:refs/remotes/glacambre/smoothscroll
file:.git/config    branch.glacambre-implement_restart.remote=glacambre
file:.git/config    branch.glacambre-implement_restart.merge=refs/heads/implement_restart
file:.git/config    branch.glacambre-implement_tristart_autocmd.remote=glacambre
file:.git/config    branch.glacambre-implement_tristart_autocmd.merge=refs/heads/implement_tristart_autocmd
file:.git/config    branch.movies.remote=origin
file:.git/config    branch.movies.merge=refs/heads/movies
file:.git/config    remote.cmcaine.url=git://github.com/cmcaine/tridactyl.git
file:.git/config    remote.cmcaine.fetch=+refs/heads/evalpipes:refs/remotes/cmcaine/evalpipes
file:.git/config    remote.cmcaine.tagopt=--no-tags
file:.git/config    remote.cmcaine.fetch=+refs/heads/evalpipes:refs/remotes/cmcaine/evalpipes
file:.git/config    remote.cmcaine.fetch=+refs/heads/configdocs:refs/remotes/cmcaine/configdocs
file:.git/config    branch.cmcaine-evalpipes.remote=cmcaine
file:.git/config    branch.cmcaine-evalpipes.merge=refs/heads/evalpipes
file:.git/config    branch.evalpipes.remote=origin
file:.git/config    branch.evalpipes.merge=refs/heads/evalpipes
file:.git/config    remote.Werkov.url=git://github.com/Werkov/tridactyl.git
file:.git/config    remote.Werkov.fetch=+refs/heads/fix-native-python:refs/remotes/Werkov/fix-native-python
file:.git/config    remote.Werkov.tagopt=--no-tags
file:.git/config    branch.Werkov-fix-native-python.remote=Werkov
file:.git/config    branch.Werkov-fix-native-python.merge=refs/heads/fix-native-python
file:.git/config    branch.kraft.remote=origin
file:.git/config    branch.kraft.merge=refs/heads/kraft
file:.git/config    remote.maxigaz.url=git://github.com/maxigaz/tridactyl.git
file:.git/config    remote.maxigaz.fetch=+refs/heads/master:refs/remotes/maxigaz/master
file:.git/config    remote.maxigaz.tagopt=--no-tags
file:.git/config    branch.maxigaz-master.remote=maxigaz
file:.git/config    branch.maxigaz-master.merge=refs/heads/master
file:.git/config    branch.glacambre-read_about_config.remote=glacambre
file:.git/config    branch.glacambre-read_about_config.merge=refs/heads/read_about_config
file:.git/config    remote.MoSal.url=git://github.com/MoSal/tridactyl.git
file:.git/config    remote.MoSal.fetch=+refs/heads/master:refs/remotes/MoSal/master
file:.git/config    remote.MoSal.tagopt=--no-tags
file:.git/config    branch.MoSal-master.remote=MoSal
file:.git/config    branch.MoSal-master.merge=refs/heads/master
file:.git/config    remote.jcrowgey.url=git://github.com/jcrowgey/tridactyl.git
file:.git/config    remote.jcrowgey.fetch=+refs/heads/set_key_prints_current_value:refs/remotes/jcrowgey/set_key_prints_current_value
file:.git/config    remote.jcrowgey.tagopt=--no-tags
file:.git/config    branch.jcrowgey-set_key_prints_current_value.remote=jcrowgey
file:.git/config    branch.jcrowgey-set_key_prints_current_value.merge=refs/heads/set_key_prints_current_value
file:.git/config    remote.ELLIOTTCABLE.url=git://github.com/ELLIOTTCABLE/tridactyl.git
file:.git/config    remote.ELLIOTTCABLE.fetch=+refs/heads/extra-colon-handling:refs/remotes/ELLIOTTCABLE/extra-colon-handling
file:.git/config    remote.ELLIOTTCABLE.tagopt=--no-tags
file:.git/config    branch.ELLIOTTCABLE-extra-colon-handling.remote=ELLIOTTCABLE
file:.git/config    branch.ELLIOTTCABLE-extra-colon-handling.merge=refs/heads/extra-colon-handling
file:.git/config    remote.caputchinefrobles.url=git://github.com/caputchinefrobles/tridactyl.git
file:.git/config    remote.caputchinefrobles.fetch=+refs/heads/css-structure-greenmat-theme:refs/remotes/caputchinefrobles/css-structure-greenmat-theme
file:.git/config    remote.caputchinefrobles.tagopt=--no-tags
file:.git/config    remote.caputchinefrobles.fetch=+refs/heads/css-structure-greenmat-theme:refs/remotes/caputchinefrobles/css-structure-greenmat-theme
file:.git/config    branch.caputchinefrobles-css-structure-greenmat-theme.remote=caputchinefrobles
file:.git/config    branch.caputchinefrobles-css-structure-greenmat-theme.merge=refs/heads/css-structure-greenmat-theme
file:.git/config    branch.caput-theme-mk2.remote=origin
file:.git/config    branch.caput-theme-mk2.merge=refs/heads/caput-theme-mk2
file:.git/config    branch.cmcaine-configdocs.remote=cmcaine
file:.git/config    branch.cmcaine-configdocs.merge=refs/heads/configdocs
file:.git/config    remote.sumnerevans.url=git://github.com/sumnerevans/tridactyl.git
file:.git/config    remote.sumnerevans.fetch=+refs/heads/doc-prettier-compliance:refs/remotes/sumnerevans/doc-prettier-compliance
file:.git/config    remote.sumnerevans.tagopt=--no-tags
file:.git/config    remote.sumnerevans.fetch=+refs/heads/css-prettier-compliance:refs/remotes/sumnerevans/css-prettier-compliance
file:.git/config    branch.sumnerevans-doc-prettier-compliance.remote=sumnerevans
file:.git/config    branch.sumnerevans-doc-prettier-compliance.merge=refs/heads/doc-prettier-compliance
file:.git/config    remote.sirn.url=git://github.com/sirn/tridactyl.git
file:.git/config    remote.sirn.fetch=+refs/heads/mac-nativeopen:refs/remotes/sirn/mac-nativeopen
file:.git/config    remote.sirn.tagopt=--no-tags
file:.git/config    branch.sirn-mac-nativeopen.remote=sirn
file:.git/config    branch.sirn-mac-nativeopen.merge=refs/heads/mac-nativeopen
file:.git/config    branch.sumnerevans-css-prettier-compliance.remote=sumnerevans
file:.git/config    branch.sumnerevans-css-prettier-compliance.merge=refs/heads/css-prettier-compliance
file:.git/config    remote.gsbabil.url=git://github.com/gsbabil/tridactyl.git
file:.git/config    remote.gsbabil.fetch=+refs/heads/gsbabil/windows-compiled-native-messenger-support:refs/remotes/gsbabil/gsbabil/windows-compiled-native-messenger-support
file:.git/config    remote.gsbabil.tagopt=--no-tags
file:.git/config    branch.gsbabil-gsbabil/windows-compiled-native-messenger-support.remote=gsbabil
file:.git/config    branch.gsbabil-gsbabil/windows-compiled-native-messenger-support.merge=refs/heads/gsbabil/windows-compiled-native-messenger-support
file:.git/config    branch.glacambre-js_pipes.remote=glacambre
file:.git/config    branch.glacambre-js_pipes.merge=refs/heads/js_pipes
file:.git/config    branch.glacambre-impl_jumplist.remote=glacambre
file:.git/config    branch.glacambre-impl_jumplist.merge=refs/heads/impl_jumplist
file:.git/config    branch.glacambre-smoothscroll.remote=glacambre
file:.git/config    branch.glacambre-smoothscroll.merge=refs/heads/smoothscroll
file:.git/config    branch.gsbabil-gsbabil/[email protected]:gsbabil/tridactyl.git
file:.git/config    branch.gsbabil-gsbabil/add-appveyor-windows-build-support.merge=refs/heads/gsbabil/add-appveyor-windows-build-support
file:.git/config    [email protected]:peff/tridactyl.git
file:.git/config    branch.native-stdin.merge=refs/heads/native-stdin
file:.git/config    [email protected]:IsaacKhor/tridactyl.git
file:.git/config    branch.completions.merge=refs/heads/completions
file:.git/config    [email protected]:Koushien/tridactyl.git
file:.git/config    branch.buffer.merge=refs/heads/buffer
file:.git/config    branch.patch-1.remote=origin
file:.git/config    branch.patch-1.merge=refs/pull/818/head

I then deleted these lines from .git/config:

[remote "glacambre"]
    url = git://github.com/glacambre/tridactyl.git
    fetch = +refs/heads/implement_restart:refs/remotes/glacambre/implement_restart
    tagopt = --no-tags
    fetch = +refs/heads/implement_tristart_autocmd:refs/remotes/glacambre/implement_tristart_autocmd
    fetch = +refs/heads/read_about_config:refs/remotes/glacambre/read_about_config
    fetch = +refs/heads/read_about_config:refs/remotes/glacambre/read_about_config
    fetch = +refs/heads/js_pipes:refs/remotes/glacambre/js_pipes
    fetch = +refs/heads/impl_jumplist:refs/remotes/glacambre/impl_jumplist
    fetch = +refs/heads/smoothscroll:refs/remotes/glacambre/smoothscroll

and I could then successfully check out any of glacambre's PR's (which previously didn't work).

The following lines were added to .git/config after checking out a PR with hub:

[branch "docfocus_blur"]
    remote = [email protected]:glacambre/tridactyl.git
    merge = refs/heads/docfocus_blur

i.e, the [remote "glacambre"] did not come back.

So I guess the questions to answer are:

  • Where did the [remote "glacambre"] section come from?
  • Why did it stop hub from working?

I'm very happy to help debug this further, @mislav. hub makes my life a lot easier (when it works!) :heart:.


Summary for anyone looking for a workaround:

cd [your project folder]
vim .git/config
# delete all lines in section [remote {user who you can't checkout from}], save and quit
hub checkout [url to PR]
# profit

@mislav I'm also hitting the same problem discussed here:

fatal: Cannot setup tracking information; starting point '...' is not a branch.

You may be interested in hearing that in hub 2.2.0 things worked for me, and after I bumped to 2.5.0 (to be sure I am on the latest to file #1827 and not complain about a problem in an old version...) it broke! :sob:

Perhaps this helps to shed more light on it:

git remote -v
gerrit  ssh://[email protected]:29418/odlparent.git (fetch)
gerrit  ssh://[email protected]:29418/odlparent.git (push)
origin  https://git.opendaylight.org/gerrit/odlparent (fetch)
origin  https://git.opendaylight.org/gerrit/odlparent (push)
vorburger   [email protected]:vorburger/odlparent.git (fetch)
vorburger   [email protected]:vorburger/odlparent.git (push)

hub checkout https://github.com/vorburger/odlparent/pull/204
fatal: Cannot setup tracking information; starting point 'vorburger/dependabot/maven/com.puppycrawl.tools-checkstyle-8.12' is not a branch.

@bovine3dom's provided details were very useful for me to understand where this problem is coming from, but I haven't had the time to fix this yet. In short, this happens on repos where hub checkout was used for the same git remotes, but with different versions of hub over time.

@vorburger Can you share with us this info? You can anonymize names of branches if you will:

git config -l --show-origin | grep vorburger

happens on repos where hub checkout was used for the same git remotes, but with different versions of hub over time.

oh so if I wiped this git repo and recloned then it work. I don't really mind doing that!

Can you share with us this info? git config -l --show-origin | grep vorburger

see https://gist.github.com/vorburger/37506778d44ff657357547c8860ae6d1 - HTH ?

BTW: No stress - I'm working around it by using the old hub version again, for now... :smile:

@vorburger If you do git remote rm vorburger && git remote add -f vorburger [email protected]:vorburger/odlparent.git, it should work again with new hub version!

If possible, don't use hub 2.2 anymore. It has known bugs!

@mislav oh OK, yeah the git remove rm & add seems to do the trick to work around this, just tried - thanks!

Won't use hub 2.2. anymore - promise! :smile:

Just wanted to say simply deleting the remote (git remote rm REMOTE_NAME) fixed it for me; when you run hub checkout PR again, it will recreate the remote.

Was this page helpful?
0 / 5 - 0 ratings