Skip to content

support for http #114

Closed
Closed

Description

@drdv

Sometimes I need to have http instead of https in the links. Currently I deal with this using

(use-package git-link
  :ensure t
  :bind ("C-c g l" . git-link)
  :config
  (setq git-link-open-in-browser t)
  (defun git-link--http-advice (func link)
    (funcall func (replace-regexp-in-string "^https:" "http:" link)))
  (defun git-link-toggle-http-advice ()
    "Toggle using http or https by advicing `git-link--new'."
    (interactive)
    (if (advice--p (advice--symbol-function 'git-link--new))
	(advice-remove 'git-link--new 'git-link--http-advice)
      (advice-add 'git-link--new :around 'git-link--http-advice)))
  (git-link-toggle-http-advice))

But clearly there is a better way to deal with this. It seems to me that it is trivial to support this in the code (e.g., by adding a variable instead of hard-coding https in the links).

Activity

  1. sshaw commented on Nov 26, 2023

    @sshaw
    Owner

    What services do you need to link to using http?

  2. drdv commented on Nov 26, 2023

    @drdv
    Author

    self-hosted gitlab

  3. sshaw commented on Jul 8, 2025

    @sshaw
    Owner

    @drdv what about adding support for URL schemes to git-link-web-host-alist. For example:

    ("ssh\\.gitlab\\.company\\.com" . "gitlab.company.com") ;; https
    ("gitlab\\.local" . "http://localhost:3000") 
  4. sshaw commented on Jul 12, 2025

    @sshaw
    Owner

    Fixed by #143

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions