sshaw / git-link

Emacs package to get the GitHub/Bitbucket/GitLab/... URL for a buffer location
394 stars 73 forks source link

add gitea support #126

Closed port19x closed 2 months ago

port19x commented 2 months ago

closes #117

port19x commented 2 months ago

my very broad regex will probably break some customizations¹ This is because alist-get fetches the first match and custom domains will likely match my regex before reaching the appended alist entry

sshaw commented 2 months ago

Hi, thanks for the PR.

my very broad regex will probably break some customizations¹

Is the use of Gitea so widespread that it is worth breaking these customizations?

Since Gitea is self-hosted and has all sorts of URLs is it even needed in ~list~ this library when one can call add-to-listas needed using the appropriate config-specific URL?

port19x commented 2 months ago

It sees a fair amount of use by corporates and self-hosting types. A way to integrate it that does not break these customizations would be to modify the alist-get calls. Adding the right appropiate backends as the third argument would set it as default, which gives further opportunity to downside the alists, especially since homepage is fairly uniform.

sshaw commented 2 months ago

A way to integrate it that does not break these customizations would be to modify the alist-get calls. Adding the right appropiate backends as the third argument would set it as default, which gives further opportunity to downside the alists, especially since homepage is fairly uniform.

This seems like unnecessary work given the alternative:

(eval-after-load 'git-link
 '(progn
   (add-to-list 'git-link-remote-alist
     '("your-custom-gitea-url" git-link-codeburg))

Maybe a defalias is needed so that one can say git-link-gitea instead?

This situation is similar to Cgit which we currently support via a custom function but it is not added to git-link-remote-alist etc... because there is no definitive URL like GitLab, etc...

sshaw commented 2 months ago

This seems like unnecessary work given the alternative: (eval-after-load 'git-link '(progn (add-to-list 'git-link-remote-alist ...

Now admittedly having to add to 3 lists is not ideal and should change. I think #115 has a proposed fix for this

port19x commented 2 months ago

Well then, given the workaround, I'll close the PR. Anyone curious enough to check the issue tracker for support will find what backends to set, so that's fine.

sshaw commented 2 months ago

Updated docs with info on how to enable Gitea support and added git-link-*gitea functions