From 0bea6b6f5dea7106fc95188253f246acc583a1a2 Mon Sep 17 00:00:00 2001 From: Andreas Gerler Date: Sun, 26 Apr 2026 19:52:19 +0200 Subject: [PATCH] update git-link --- elpa/git-link-20260411.1730/README-elpa | 6 +++ .../git-link-autoloads.el | 12 +++--- .../git-link-pkg.el | 8 ++-- .../git-link-transient.el | 0 .../git-link.el | 37 +++++++++++++++---- 5 files changed, 45 insertions(+), 18 deletions(-) create mode 100644 elpa/git-link-20260411.1730/README-elpa rename elpa/{git-link-20250812.1427 => git-link-20260411.1730}/git-link-autoloads.el (86%) rename elpa/{git-link-20250812.1427 => git-link-20260411.1730}/git-link-pkg.el (67%) rename elpa/{git-link-20250812.1427 => git-link-20260411.1730}/git-link-transient.el (100%) rename elpa/{git-link-20250812.1427 => git-link-20260411.1730}/git-link.el (96%) diff --git a/elpa/git-link-20260411.1730/README-elpa b/elpa/git-link-20260411.1730/README-elpa new file mode 100644 index 00000000..cd88ad67 --- /dev/null +++ b/elpa/git-link-20260411.1730/README-elpa @@ -0,0 +1,6 @@ +Create URLs for files and commits in GitHub/Bitbucket/GitLab/... +repositories. `git-link' returns the URL for the current buffer's file +location at the current line number or active region. `git-link-commit' +returns the URL for a commit. URLs are added to the kill ring. + +With a prefix argument prompt for the remote's name. Defaults to "origin". diff --git a/elpa/git-link-20250812.1427/git-link-autoloads.el b/elpa/git-link-20260411.1730/git-link-autoloads.el similarity index 86% rename from elpa/git-link-20250812.1427/git-link-autoloads.el rename to elpa/git-link-20260411.1730/git-link-autoloads.el index a616f26d..270491d8 100644 --- a/elpa/git-link-20250812.1427/git-link-autoloads.el +++ b/elpa/git-link-20260411.1730/git-link-autoloads.el @@ -11,8 +11,8 @@ ;;; Generated autoloads from git-link.el -(autoload 'git-link "git-link" "\ -Create a URL representing the current buffer's location in its +(autoload 'git-link "git-link" +"Create a URL representing the current buffer's location in its GitHub/Bitbucket/GitLab/... repository at the current line number or active region. The URL will be added to the kill ring. If `git-link-open-in-browser' is non-nil also call `browse-url'. @@ -27,8 +27,8 @@ With a double prefix argument invert the value of `git-link-use-commit'. (fn REMOTE START END)" t) -(autoload 'git-link-commit "git-link" "\ -Create a URL representing the commit for the hash under point +(autoload 'git-link-commit "git-link" +"Create a URL representing the commit for the hash under point in the current buffer's GitHub/Bitbucket/GitLab/... repository. The URL will be added to the kill ring. @@ -36,8 +36,8 @@ With a prefix argument prompt for the remote's name. Defaults to \"origin\". (fn REMOTE)" t) -(autoload 'git-link-homepage "git-link" "\ -Create a URL representing the homepage of the current +(autoload 'git-link-homepage "git-link" +"Create a URL representing the homepage of the current buffer's GitHub/Bitbucket/GitLab/... repository. The URL will be added to the kill ring. If `git-link-open-in-browser' is non-nil or if you pass the double prefix (Ctrl-u Ctrl-u), then also call diff --git a/elpa/git-link-20250812.1427/git-link-pkg.el b/elpa/git-link-20260411.1730/git-link-pkg.el similarity index 67% rename from elpa/git-link-20250812.1427/git-link-pkg.el rename to elpa/git-link-20260411.1730/git-link-pkg.el index cfa5a604..c65a70e5 100644 --- a/elpa/git-link-20250812.1427/git-link-pkg.el +++ b/elpa/git-link-20260411.1730/git-link-pkg.el @@ -1,10 +1,10 @@ ;; -*- no-byte-compile: t; lexical-binding: nil -*- -(define-package "git-link" "20250812.1427" +(define-package "git-link" "20260411.1730" "Get the GitHub/Bitbucket/GitLab URL for a buffer location." '((emacs "24.3")) - :url "http://github.com/sshaw/git-link" - :commit "e4cfed05d110a6af07543d069f12e1894f553c2e" - :revdesc "e4cfed05d110" + :url "https://github.com/sshaw/git-link" + :commit "b651de43236276cdb18ec7727f645cbf6743a499" + :revdesc "b651de432362" :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-20250812.1427/git-link-transient.el b/elpa/git-link-20260411.1730/git-link-transient.el similarity index 100% rename from elpa/git-link-20250812.1427/git-link-transient.el rename to elpa/git-link-20260411.1730/git-link-transient.el diff --git a/elpa/git-link-20250812.1427/git-link.el b/elpa/git-link-20260411.1730/git-link.el similarity index 96% rename from elpa/git-link-20250812.1427/git-link.el rename to elpa/git-link-20260411.1730/git-link.el index f81c575b..f2517c0e 100644 --- a/elpa/git-link-20250812.1427/git-link.el +++ b/elpa/git-link-20260411.1730/git-link.el @@ -1,9 +1,9 @@ ;;; git-link.el --- Get the GitHub/Bitbucket/GitLab URL for a buffer location -*- lexical-binding: t -*- -;; Copyright (C) 2013-2022 Skye Shaw and others +;; Copyright (C) 2013-2025 Skye Shaw and others ;; Author: Skye Shaw -;; Package-Version: 20250812.1427 -;; Package-Revision: e4cfed05d110 +;; Package-Version: 20260411.1730 +;; Package-Revision: b651de432362 ;; Keywords: git, vc, github, bitbucket, gitlab, sourcehut, aws, azure, convenience ;; URL: http://github.com/sshaw/git-link ;; Package-Requires: ((emacs "24.3")) @@ -36,6 +36,13 @@ ;;; Change Log: +;; 2025-10-23 - v0.10.0 +;; * Add: support for linking to custom web hosts (Issue #136, thanks Sebastian Poeplau) +;; * Add: Transient menu interface (Issues #128 and #132, thanks Yikai Zhao and David Morgan) +;; * Fix: linking under vc mode when default-directory is nil +;; * Fix: hexification of nil branch name (Issue #127, thanks Michael Hauser-Raspe) +;; * Fix: Codeberg permalinks (Issue #147, thanks Marty Hiatt) +;; ;; 2024-06-29 - v0.9.2 ;; * Add git-link-add-to-kill-ring to not add to kill ring (thanks Michael Hauser-Raspe) ;; * Add prefix arg to open in browser when calling git-link-homepage (thanks Sibi Prabakaran) @@ -244,7 +251,8 @@ See its docs." ("googlesource.com" git-link-googlesource) ("visualstudio\\|azure" git-link-azure) ("sourcegraph" git-link-sourcegraph) - ("\\(amazonaws\\|amazon\\)\\.com" git-link-codecommit)) + ("\\(amazonaws\\|amazon\\)\\.com" git-link-codecommit) + ("forge.fedoraproject.org" git-link-codeberg)) "Alist of host names and functions creating file links for those. Each element looks like (REGEXP FUNCTION) where REGEXP is used to match the remote's host name and FUNCTION is used to generate a link @@ -266,7 +274,8 @@ As an example, \"gitlab\" will match with both \"gitlab.com\" and ("googlesource.com" git-link-commit-googlesource) ("visualstudio\\|azure" git-link-commit-azure) ("sourcegraph" git-link-commit-sourcegraph) - ("\\(amazonaws\\|amazon\\)\\.com" git-link-commit-codecommit)) + ("\\(amazonaws\\|amazon\\)\\.com" git-link-commit-codecommit) + ("forge.fedoraproject.org" git-link-commit-codeberg)) "Alist of host names and functions creating commit links for those. Each element looks like (REGEXP FUNCTION) where REGEXP is used to match the remote's host name and FUNCTION is used to generate a link @@ -287,7 +296,8 @@ As an example, \"gitlab\" will match with both \"gitlab.com\" and ("googlesource.com" git-link-homepage-github) ("visualstudio\\|azure" git-link-homepage-github) ("sourcegraph" git-link-homepage-github) - ("\\(amazonaws\\|amazon\\)\\.com" git-link-homepage-codecommit)) + ("\\(amazonaws\\|amazon\\)\\.com" git-link-homepage-codecommit) + ("forge.fedoraproject.org" git-link-homepage-codeberg)) "Alist of host names and functions creating homepage links for those. Each element looks like (REGEXP FUNCTION) where REGEXP is used to match the remote's host name and FUNCTION is used to generate a link @@ -826,6 +836,9 @@ is prepended to it." (defun git-link-homepage-codecommit (hostname dirname) (format "%s/%s/browse" hostname dirname)) +(defun git-link-homepage-codeberg (hostname dirname) + (format "%s/%s" hostname dirname)) + (define-obsolete-function-alias 'git-link-homepage-svannah 'git-link-homepage-savannah "cf947f9") @@ -837,6 +850,9 @@ is prepended to it." (git-link--read-remote) (git-link--remote))) +(defun git-link--commit-hash-p (commit) + (string-match-p "[a-fA-F0-9]\\{7,40\\}" (or commit ""))) + (defun git-link--should-render-plain (filename) "Check if the extension of the given filename belongs to the list of extensions which generated link should be @@ -939,15 +955,20 @@ Defaults to \"origin\"." (if (null remote-url) (message "Remote `%s' not found" remote) + (setq commit (word-at-point)) + (when (and (not (git-link--commit-hash-p commit)) + (derived-mode-p 'magit-revision-mode) + (boundp 'magit-buffer-revision)) + (setq commit magit-buffer-revision)) + (setq remote-info (git-link--parse-remote remote-url) git-host (car remote-info) - commit (word-at-point) handler (git-link--handler git-link-commit-remote-alist git-host) web-host (git-link--web-host git-host)) (cond ((null git-host) (message "Remote `%s' contains an unsupported URL" remote)) - ((not (string-match-p "[a-fA-F0-9]\\{7,40\\}" (or commit ""))) + ((not (git-link--commit-hash-p commit)) (message "Point is not on a commit hash")) ((not (functionp handler)) (message "No handler for %s" git-host)) -- 2.47.3