feat(ext_remote): use git if installed to support any repo #1203
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While #1196 solved the issue with hitting GitHubs API rate limits, and also made the code simpler and more standardized, it still assumed that:
https://host.tld/user/repo
This was true for all the hosts we supported, and with this PR if the host is github, gitlab or codeberg or if the user doesn't have git installed it, it keeps using the old (tarball) install, as that's faster.
But if the user has git installed and trying to install from any other host it will instead use
git clone --bare
andcheckout
, which should work for any git host. This includes local paths such asfile:///home/me/my-code/my-ulauncher-extensions
(thefile://
prefix is optional, so you can use just/path/to/dir
. It will store the url with thefile://
-protocol either way).This has also been documented as a replacement from the debugging instructions we removed (63fc112). I think this is a good enough substitute and arguably fixes #818. While not as powerful as using
ipdb
I think that was way too complicated ("leaky" abstraction). Extensions are not complicated enough to need that.The recommended/supported url format now is the HTTPS git repo you use for cloning (so
https://github.com/user/repo.git
rather than justhttps://github.com/user/repo
). Either ones will work for github, gitlab or codeberg, but for other hosts we need the exact HTTPS GIT remote URL.Unfortunarely ExtensionRemote has now become quite complex and hard to test again, and I want to merge the remote and downloader classes (downloader is just a thin layer over remote now). So I don't want to add lots of tests and then have to rewrite them anyway.