jorgebucaran / fisher

A plugin manager for Fish
https://git.io/fisher
MIT License
7.85k stars 264 forks source link

custom hosted repositories not working #464

Closed norcalli closed 6 years ago

norcalli commented 6 years ago

I host some repos on my personal server, and the new version of fisher seems to assume that it is a github repository anyway:

❯ fisher add kiani.io/repos/autojump
fetching https://codeload.github.com/fisherman/await/tar.gz/master
...
fetching https://codeload.github.com/kiani.io/repos/autojump/tar.gz/master
cannot install github.com/kiani.io/repos/autojump -- are you offline?

Versions:

OS: Arch Linux x86_64
Host: Inspiron 5675 1.1.2
Kernel: 4.18.10-arch1-1-ARCH
Shell: fish 2.7.1
fisher version 3.0.8 ~/.config/fish/functions/fisher.fish
jorgebucaran commented 6 years ago

Acknowledged. Not yet implemented.

@norcalli How am I suppose to clone from kiani.io/repos/autojump? Where's the repository? Can you show me how you use git to download your repository?

norcalli commented 6 years ago

Ah, ok. I thought it would be an extension of being able to clone from gitlab.com which would support all custom domain names, but I'm guessing that might be special cased?

Essentially I'm using ssh to interface with a repo on my personal server where a bare git repository is set up to receive a copy, so a private mirror of my projects.

I also tried using ssh style syntax for the url and that didn't work, so if you want to avoid having to parse like that, an alternative could be using the ashkan@kiani.io:repos/autojump.git syntax, where if it has an @ it should be interpreted as a git url.

Currently if I attempt fisher add ashkan@kiani.io:repos/autojump.git then I get

...
cannot install github.com/ashkan -- are you offline?
...
jorgebucaran commented 6 years ago

@norcalli What I mean, without telling me your password, what are the exact commands you type in the command line to clone your repository? Ignore fisher for a second.

jorgebucaran commented 6 years ago

@norcalli GitHub.com, GitLab.com, and BitBucket.org are supported.

norcalli commented 6 years ago

For completeness, I would run

git clone ashkan@kiani.io:repos/autojump.git

However, since my username on my remote machine and my local are both ashkan, I originally just did

git clone kiani.io:repos/autojump.git

And the repos is just a directory I created in the remote machine with the command

ssh kiani.io "sh -c 'mkdir repos/autojump.git && cd repos/autojump.git && git init --bare'"

jorgebucaran commented 6 years ago

@norcalli I have a few questions, sorry for your trouble.

Do you also always type in your password or is that information already locally stored in your machine so that when you use git no password prompt is shown?

Also, thank you for creating a user for me in your server so that I can test this feature. So, I was able to log in and create a repo, but I couldn't clone because I didn't have a password. What am I missing?

norcalli commented 6 years ago

@jorgebucaran I've made an example for you. I saw the repo you made, and the mistake was that it wasn't a bare repository. Therefore, I made an example repository that you can try to clone against using the following command on your local computer:

git clone guest@kiani.io:fisher-test.git

The way that git works is that when it isn't using HTTP to clone a repository, it uses ssh behind the scenes, and git will be default use the credentials you have stored. Therefore, the syntax closely resembles the one you would use for sshing somewhere.

The syntax is as follows: $USERNAME@$SERVER:$REPOSITORY_PATH. The part after the semicolon : is the path on the remote server pointing at a repository initialized with the command git init --bare. The --bare is important.

norcalli commented 6 years ago

And it's no bother. Thank you for taking the time to address this and making fisher. :)

jorgebucaran commented 6 years ago

My pleasure. 💯

jorgebucaran commented 6 years ago

@norcalli You should be able to install a package hosted in a custom server using a URL like owner@host.xz:path/to/repo (4d953fa).

Example:

fisher add guest@kiani.io:fish-hello-remote

Additionally, the branch syntax is supported if a branch with the specified name exists:

fisher add guest@kiani.io:fish-hello-remote@hotfix

This may need more work, so please try again and let me know how it goes.

norcalli commented 6 years ago

So far, so good. I'll let you know if I run into trouble. Thanks!

jorgebucaran commented 4 years ago

@norcalli Just a friendly warning that this is going to be reversed soon! Please use a private GitHub/GitLab/BitBucket repo.