mislav / hub

A command-line tool that makes git easier to use with GitHub.
https://hub.github.com/
MIT License
22.84k stars 2.2k forks source link

`hub fetch` doesn't work #315

Closed asmeurer closed 11 years ago

asmeurer commented 11 years ago

I'm not sure why, but hub fetch bgee didn't work for this repo. hub remote add bgee did work (and subsequent hub fetch bgees obviously worked).

mislav commented 11 years ago

Can't reproduce. Can you tell us your hub version? Please upgrade to the latest and test again, also provide the actual failing message (or describe the way in which it fails)

asmeurer commented 11 years ago
$hub fetch bgee
fatal: 'bgee' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
$hub --version
git version 1.8.2.1
hub version 1.10.4

(should be bbbc34680ca72a1eefeec3f07e4a724181598eae, assuming the install automatically stays up-to-date with the git clone)

asmeurer commented 11 years ago

Oh, I guess it doesn't keep up-to-date against it. So I misunderstood how rake works. This actually works fine in the git master.

Is there some way to make it just point to the git repo? The ruby equivalent of Python's setupegg.py develop?

mislav commented 11 years ago

I have this hub executable in my PATH:

#!/bin/sh
dir="/path/to/hub/checkout"
exec -a hub /usr/bin/ruby -I "${dir}/lib" "${dir}/bin/hub" "$@"
asmeurer commented 11 years ago

You're saying I should manually add something like that or that rake should have done that for me?

mislav commented 11 years ago

No, rake just bakes a standalone script that you can drop into PATH. If you want to run hub directly from a git checkout (I do that, and it seems you want that as well), create an executable in your path like I showed you above.

Hacks like this are not uncommon.

asmeurer commented 11 years ago

OK. I know basically nothing about Ruby, but if a setup.py develop equivalent doesn't exist, it should. It's extremely useful for pure Python projects if you like to work off of git.

asmeurer commented 11 years ago

I instead added

hub_dir="/Users/aaronmeurer/Documents/hub"
hub () {
    ruby -I "${hub_dir}/lib" "${hub_dir}/bin/hub" "$@"
}

to my .profile.