jorgebucaran / fisher

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

Gitlab support #657

Closed ainmosni closed 2 years ago

ainmosni commented 3 years ago

Right now, install tries to use codeload.github.com to fetch any non-local package. This makes it impossible for fisher to install plugins from GitLab or any other hosts. I found #337, which indicates that gitlab was supported at one point, can support for gitlab (and potentially other hosts) be restored?

jorgebucaran commented 3 years ago

We could if it's not a lot of work. Do you want to send a PR?

Here is where we set the URL before attempting to curl-download it.

ainmosni commented 3 years ago

Yeah I already found that, what would the preferred syntax be? To keep the rest of the logic intact, I could go gitlab specific and make it gitlab:user/repo, and then someone else can add more generic support later.

Scrumplex commented 3 years ago

fisher used to have gitlab.com/user/repo before iirc.

ainmosni commented 3 years ago

That's also fine, I have no strong feelings tbh.

jorgebucaran commented 3 years ago

gitlab.com/user/repo would be the least surprising way to go about this IMO.

jorgebucaran commented 3 years ago

Something like this might do it. All the escaping is because we happen to calculate the URL inside the background job. 🤖

switch $plugin
    case gitlab\\*
        set url https://\$name[1]/-/archive/\$name[2]/(string replace --all --regex -- '^.*/' '' \$name[1])-\$name[2].tar.gz
    case \\*
        set url https://codeload.github.com/\$name[1]/tar.gz/\$name[2]
end
ainmosni commented 3 years ago

@jorgebucaran I went a bit different, and yeah the escaping broke my head for a bit. :)

jorgebucaran commented 3 years ago

Just to let you know that this is still on my radar. I am just letting it cook for a while.

TeddyDD commented 3 years ago

While you at it, why not to add support for fetching arbitrary tar.gz? This would enable users to use any code hosting (as long it allows downloading branch as tarball). So Sourcehut, Gitea, HTTP server running on the toaster etc. would be supported.

Never mind, I'll open a separate issue.

BVollmerhaus commented 2 years ago

I upgraded Fisher without knowing about this change, and now it's essentially become useless for me, unfortunately. Wish it would've been noted in the changelog. Is there an easy way to revert to an older version?

Edit: Reverting to the old installation method of downloading fisher.fish directly (from a 3.x tag) worked fine.

jorgebucaran commented 2 years ago

Wish it would've been noted in the changelog

It was.

I'm considering to bring it back. Maybe you can help by trying out #658.

BVollmerhaus commented 2 years ago

Ah, I completely missed it because it was (a bit unusually) shortened to "GL/BB". In any case, version 3.3.2 works just fine for now.

I'll try out the branch in #658 when I get around to it; thanks for the pointer.