From 67573428bfcba5eb91cb286153ec593666c2a437 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Sat, 19 Jun 2021 09:41:31 -0300 Subject: Add support for pagure.io I only added support for HTTPS remotes, because I'm not willing to go out of my way for creating a Fedora account just to see what an SSH URL looks like. I guess just the prefix would change, but repositories not named "A/B.git" but just "B.git" would need more (trivial) treatment, which I'm not willing to do. It shall stay this way until a contribution comes to improve it, or Pagure stops making it hard for me to implement this. --- src/git-permalink.sh | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src') diff --git a/src/git-permalink.sh b/src/git-permalink.sh index ce871ff..4a6b2ee 100755 --- a/src/git-permalink.sh +++ b/src/git-permalink.sh @@ -166,6 +166,10 @@ codeberg() { printf '%s/src/commit/%s/%s%s\n' "$ORIGIN" "$COMMIT" "$FILE" "$(lineno_with_l)" } +pagure() { + printf '%s/blob/%s/f/%s%s\n' "$ORIGIN" "$COMMIT" "$FILE" "${MYLINENO:+#_$MYLINENO}" +} + gitlab() { normalize_origin printf '%s/-/blob/%s/%s%s\n' "$ORIGIN" "$COMMIT" "$FILE" "${MYLINENO:+#L$MYLINENO}" @@ -200,6 +204,9 @@ guess_permalink() { *codeberg.org*) codeberg ;; + *pagure.io*) + pagure + ;; *gitlab.com*) gitlab ;; -- cgit v1.2.3