Skip to content

Commit d01f932

Browse files
Copilotsshaw
andcommitted
Add missing git-link-commit-sourcehut function and fix alist reference
Co-authored-by: sshaw <17570+sshaw@users.noreply.github.com>
1 parent d765bbe commit d01f932

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

git-link-test.el

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,11 @@
334334
(should (equal "https://sourcegraph.com/user/repo/-/commit/abc123"
335335
(git-link-commit-sourcegraph "https://sourcegraph.com" "user/repo" "abc123"))))
336336

337+
(ert-deftest git-link-commit-sourcehut ()
338+
"Test git-link-commit-sourcehut function."
339+
(should (equal "https://git.sr.ht/~user/repo/commit/abc123"
340+
(git-link-commit-sourcehut "https://git.sr.ht" "~user/repo" "abc123"))))
341+
337342
(ert-deftest git-link-commit-codecommit ()
338343
"Test git-link-commit-codecommit function."
339344
(should (equal "https://us-west-2.console.aws.amazon.com/codesuite/codecommit/repositories/repo/commit/abc123"

git-link.el

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ As an example, \"gitlab\" will match with both \"gitlab.com\" and
255255
:group 'git-link)
256256

257257
(defcustom git-link-commit-remote-alist
258-
'(("git.sr.ht" git-link-commit-github)
258+
'(("git.sr.ht" git-link-commit-sourcehut)
259259
("codeberg.org" git-link-commit-codeberg)
260260
("github" git-link-commit-github)
261261
("bitbucket" git-link-commit-bitbucket)
@@ -672,6 +672,12 @@ is prepended to it."
672672
(format "L%s-%s" start end)
673673
(format "L%s" start)))))))
674674

675+
(defun git-link-commit-sourcehut (hostname dirname commit)
676+
(format "%s/%s/commit/%s"
677+
hostname
678+
dirname
679+
commit))
680+
675681
(defun git-link-commit-gitlab (hostname dirname commit)
676682
(format "%s/%s/-/commit/%s"
677683
hostname

0 commit comments

Comments
 (0)