diff options
author | EuAndreh <eu@euandre.org> | 2021-06-19 09:41:31 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2021-06-19 09:41:55 -0300 |
commit | 67573428bfcba5eb91cb286153ec593666c2a437 (patch) | |
tree | 5128d583d4a1740ded60809cd419617eab9a1c87 /src/git-permalink.sh | |
parent | Add support for codeberg.org (diff) | |
download | git-permalink-67573428bfcba5eb91cb286153ec593666c2a437.tar.gz git-permalink-67573428bfcba5eb91cb286153ec593666c2a437.tar.xz |
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.
Diffstat (limited to 'src/git-permalink.sh')
-rwxr-xr-x | src/git-permalink.sh | 7 |
1 files changed, 7 insertions, 0 deletions
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 ;; |