From 66d7fe452a2d101e9816dea8301b80a596958b7d Mon Sep 17 00:00:00 2001 From: Andreas Gerler Date: Wed, 21 May 2025 14:41:15 +0200 Subject: [PATCH] update git-link --- .../git-link-autoloads.el | 0 .../git-link-pkg.el | 8 ++--- .../git-link-transient.el | 0 .../git-link.el | 34 +++++++++++++++---- 4 files changed, 31 insertions(+), 11 deletions(-) rename elpa/{git-link-20241208.1850 => git-link-20250214.1240}/git-link-autoloads.el (100%) rename elpa/{git-link-20241208.1850 => git-link-20250214.1240}/git-link-pkg.el (67%) rename elpa/{git-link-20241208.1850 => git-link-20250214.1240}/git-link-transient.el (100%) rename elpa/{git-link-20241208.1850 => git-link-20250214.1240}/git-link.el (96%) diff --git a/elpa/git-link-20241208.1850/git-link-autoloads.el b/elpa/git-link-20250214.1240/git-link-autoloads.el similarity index 100% rename from elpa/git-link-20241208.1850/git-link-autoloads.el rename to elpa/git-link-20250214.1240/git-link-autoloads.el diff --git a/elpa/git-link-20241208.1850/git-link-pkg.el b/elpa/git-link-20250214.1240/git-link-pkg.el similarity index 67% rename from elpa/git-link-20241208.1850/git-link-pkg.el rename to elpa/git-link-20250214.1240/git-link-pkg.el index 6eeed771..b73e2ef2 100644 --- a/elpa/git-link-20241208.1850/git-link-pkg.el +++ b/elpa/git-link-20250214.1240/git-link-pkg.el @@ -1,10 +1,10 @@ ;; -*- no-byte-compile: t; lexical-binding: nil -*- -(define-package "git-link" "20241208.1850" +(define-package "git-link" "20250214.1240" "Get the GitHub/Bitbucket/GitLab URL for a buffer location." '((emacs "24.3")) - :url "https://github.com/sshaw/git-link" - :commit "40f7b1674d2c703199ff2f82b464f17aa6f61b4b" - :revdesc "40f7b1674d2c" + :url "http://github.com/sshaw/git-link" + :commit "8d0f98cf36f6b9c31285329b054ae77f9a3d9b33" + :revdesc "8d0f98cf36f6" :keywords '("git" "vc" "github" "bitbucket" "gitlab" "sourcehut" "aws" "azure" "convenience") :authors '(("Skye Shaw" . "skye.shaw@gmail.com")) :maintainers '(("Skye Shaw" . "skye.shaw@gmail.com"))) diff --git a/elpa/git-link-20241208.1850/git-link-transient.el b/elpa/git-link-20250214.1240/git-link-transient.el similarity index 100% rename from elpa/git-link-20241208.1850/git-link-transient.el rename to elpa/git-link-20250214.1240/git-link-transient.el diff --git a/elpa/git-link-20241208.1850/git-link.el b/elpa/git-link-20250214.1240/git-link.el similarity index 96% rename from elpa/git-link-20241208.1850/git-link.el rename to elpa/git-link-20250214.1240/git-link.el index f8535fa6..5d285a6b 100644 --- a/elpa/git-link-20241208.1850/git-link.el +++ b/elpa/git-link-20250214.1240/git-link.el @@ -2,8 +2,8 @@ ;; Copyright (C) 2013-2022 Skye Shaw and others ;; Author: Skye Shaw -;; Package-Version: 20241208.1850 -;; Package-Revision: 40f7b1674d2c +;; Package-Version: 20250214.1240 +;; Package-Revision: 8d0f98cf36f6 ;; Keywords: git, vc, github, bitbucket, gitlab, sourcehut, aws, azure, convenience ;; URL: http://github.com/sshaw/git-link ;; Package-Requires: ((emacs "24.3")) @@ -314,6 +314,22 @@ they will actually be rendered. We can prevent that behaviour." :type 'list :group 'git-link) +(defcustom git-link-web-host-alist nil + "Mapping from Git host names to web host names. + +Elements have the form (GIT-HOST-REGEXP . WEB-HOST), where +GIT-HOST-REGEXP is a regexp matching the host name used by Git +and WEB-HOST is the name of the host serving the corresponding +web interface. + +This can be used when custom deployments serve SSH access and the +web interface under different host names. For example, if Git +uses \"ssh.gitlab.company.com\" but the web interface is at +\"gitlab.company.com\", add +`(\"ssh\\\\.gitlab\\\\.company\\\\.com\" . \"gitlab.company.com\")'." + :type '(alist :key-type string :value-type string) + :group 'git-link) + (defun git-link--exec(&rest args) (ignore-errors (with-temp-buffer @@ -846,22 +862,26 @@ With a double prefix argument invert the value of (list remote nil nil) (list remote (car region) (cadr region)))))) - (let (filename branch commit handler remote-info (remote-url (git-link--remote-url remote))) + (let ((remote-url (git-link--remote-url remote)) + filename branch commit handler remote-info git-host web-host) (if (null remote-url) (message "Remote `%s' not found" remote) (setq remote-info (git-link--parse-remote remote-url) + git-host (car remote-info) filename (git-link--relative-filename) branch (git-link--branch) commit (git-link--commit) - handler (git-link--handler git-link-remote-alist (car remote-info))) + handler (git-link--handler git-link-remote-alist git-host) + web-host (or (assoc-default git-host git-link-web-host-alist #'string-match-p) + git-host)) (cond ((null filename) (message "Can't figure out what to link to")) - ((null (car remote-info)) + ((null git-host) (message "Remote `%s' contains an unsupported URL" remote)) ((not (functionp handler)) - (message "No handler found for %s" (car remote-info))) + (message "No handler found for %s" git-host)) ;; TODO: null ret val (t (let ((vc-revison (git-link--parse-vc-revision filename))) @@ -871,7 +891,7 @@ With a double prefix argument invert the value of (git-link--new (funcall handler - (car remote-info) + web-host (cadr remote-info) (url-hexify-string filename (url--allowed-chars (cons ?/ url-unreserved-chars))) (if (or (git-link--using-git-timemachine) -- 2.47.3