Skip to content

Commit 12caebc

Browse files
authored
Merge pull request #150 from FrostyX/forge-fedora
Recognize forge.fedoraproject.org as a codeberg instance
2 parents 67b02cf + 8dadb22 commit 12caebc

2 files changed

Lines changed: 13 additions & 3 deletions

File tree

git-link-test.el

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,3 +356,7 @@
356356
(git-link-homepage-codecommit "https://us-west-2.console.aws.amazon.com" "codesuite/codecommit/repositories/repo"))))
357357

358358

359+
(ert-deftest git-link-homepage-codeberg ()
360+
"Test git-link-homepage-codeberg function."
361+
(should (equal "https://codeberg.org/user/repo"
362+
(git-link-homepage-codeberg "https://codeberg.org" "user/repo"))))

git-link.el

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,8 @@ See its docs."
250250
("googlesource.com" git-link-googlesource)
251251
("visualstudio\\|azure" git-link-azure)
252252
("sourcegraph" git-link-sourcegraph)
253-
("\\(amazonaws\\|amazon\\)\\.com" git-link-codecommit))
253+
("\\(amazonaws\\|amazon\\)\\.com" git-link-codecommit)
254+
("forge.fedoraproject.org" git-link-codeberg))
254255
"Alist of host names and functions creating file links for those.
255256
Each element looks like (REGEXP FUNCTION) where REGEXP is used to
256257
match the remote's host name and FUNCTION is used to generate a link
@@ -272,7 +273,8 @@ As an example, \"gitlab\" will match with both \"gitlab.com\" and
272273
("googlesource.com" git-link-commit-googlesource)
273274
("visualstudio\\|azure" git-link-commit-azure)
274275
("sourcegraph" git-link-commit-sourcegraph)
275-
("\\(amazonaws\\|amazon\\)\\.com" git-link-commit-codecommit))
276+
("\\(amazonaws\\|amazon\\)\\.com" git-link-commit-codecommit)
277+
("forge.fedoraproject.org" git-link-commit-codeberg))
276278
"Alist of host names and functions creating commit links for those.
277279
Each element looks like (REGEXP FUNCTION) where REGEXP is used to
278280
match the remote's host name and FUNCTION is used to generate a link
@@ -293,7 +295,8 @@ As an example, \"gitlab\" will match with both \"gitlab.com\" and
293295
("googlesource.com" git-link-homepage-github)
294296
("visualstudio\\|azure" git-link-homepage-github)
295297
("sourcegraph" git-link-homepage-github)
296-
("\\(amazonaws\\|amazon\\)\\.com" git-link-homepage-codecommit))
298+
("\\(amazonaws\\|amazon\\)\\.com" git-link-homepage-codecommit)
299+
("forge.fedoraproject.org" git-link-homepage-codeberg))
297300
"Alist of host names and functions creating homepage links for those.
298301
Each element looks like (REGEXP FUNCTION) where REGEXP is used to
299302
match the remote's host name and FUNCTION is used to generate a link
@@ -832,6 +835,9 @@ is prepended to it."
832835
(defun git-link-homepage-codecommit (hostname dirname)
833836
(format "%s/%s/browse" hostname dirname))
834837

838+
(defun git-link-homepage-codeberg (hostname dirname)
839+
(format "%s/%s" hostname dirname))
840+
835841
(define-obsolete-function-alias
836842
'git-link-homepage-svannah 'git-link-homepage-savannah "cf947f9")
837843

0 commit comments

Comments
 (0)