From 4b60e3a6a033260dd5201121cefdec8ce34897bb Mon Sep 17 00:00:00 2001 From: Stefano Volpe Date: Sat, 4 Oct 2025 22:56:22 +0200 Subject: [PATCH 1/3] feat: Codeberg API --- README.md | 5 +++++ lua/neogit/config.lua | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/README.md b/README.md index 5ab8cae3c..4a90858cf 100644 --- a/README.md +++ b/README.md @@ -121,6 +121,11 @@ neogit.setup { commit = "", tree = "", }, + ["codeberg.org"] = { + pull_request = "https://codeberg.org/${owner}/${repository}/compare/${branch_name}", + commit = "https://github.com/${owner}/${repository}/commit/${oid}", + tree = "https://${host}/${owner}/${repository}/src/branch/${branch_name}", + }, }, -- Allows a different telescope sorter. Defaults to 'fuzzy_with_index_bias'. The example below will use the native fzf -- sorter instead. By default, this function returns `nil`. diff --git a/lua/neogit/config.lua b/lua/neogit/config.lua index 8b3c7fff0..fabf99bbd 100644 --- a/lua/neogit/config.lua +++ b/lua/neogit/config.lua @@ -429,6 +429,11 @@ function M.get_default_values() commit = "", tree = "", }, + ["codeberg.org"] = { + pull_request = "https://codeberg.org/${owner}/${repository}/compare/${branch_name}", + commit = "https://github.com/${owner}/${repository}/commit/${oid}", + tree = "https://${host}/${owner}/${repository}/src/branch/${branch_name}", + }, }, highlight = {}, disable_insert_on_commit = "auto", From eef4d0c6635659a90105de70358ac5e6e931be9b Mon Sep 17 00:00:00 2001 From: Stefano Volpe Date: Sun, 5 Oct 2025 10:29:04 +0200 Subject: [PATCH 2/3] fix: correct Codeberg endpoints --- README.md | 4 ++-- lua/neogit/config.lua | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 4a90858cf..1f17f1d8e 100644 --- a/README.md +++ b/README.md @@ -122,8 +122,8 @@ neogit.setup { tree = "", }, ["codeberg.org"] = { - pull_request = "https://codeberg.org/${owner}/${repository}/compare/${branch_name}", - commit = "https://github.com/${owner}/${repository}/commit/${oid}", + pull_request = "https://${host}/${owner}/${repository}/compare/${branch_name}", + commit = "https://${host}/${owner}/${repository}/commit/${oid}", tree = "https://${host}/${owner}/${repository}/src/branch/${branch_name}", }, }, diff --git a/lua/neogit/config.lua b/lua/neogit/config.lua index fabf99bbd..a036ea9e0 100644 --- a/lua/neogit/config.lua +++ b/lua/neogit/config.lua @@ -430,8 +430,8 @@ function M.get_default_values() tree = "", }, ["codeberg.org"] = { - pull_request = "https://codeberg.org/${owner}/${repository}/compare/${branch_name}", - commit = "https://github.com/${owner}/${repository}/commit/${oid}", + pull_request = "https://${host}/${owner}/${repository}/compare/${branch_name}", + commit = "https://${host}/${owner}/${repository}/commit/${oid}", tree = "https://${host}/${owner}/${repository}/src/branch/${branch_name}", }, }, From 6a95a60c89c04c95a83112e67438ea78fc35f4a0 Mon Sep 17 00:00:00 2001 From: Stefano Volpe Date: Sun, 5 Oct 2025 10:31:29 +0200 Subject: [PATCH 3/3] doc: add Codeberg to doc/neogit.txt --- doc/neogit.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/neogit.txt b/doc/neogit.txt index 5616a1d92..fa407c58d 100644 --- a/doc/neogit.txt +++ b/doc/neogit.txt @@ -135,6 +135,11 @@ to Neovim users. commit = "", tree = "", }, + ["codeberg.org"] = { + pull_request = "https://${host}/${owner}/${repository}/compare/${branch_name}", + commit = "https://${host}/${owner}/${repository}/commit/${oid}", + tree = "https://${host}/${owner}/${repository}/src/branch/${branch_name}", + }, }, -- Allows a different telescope sorter. Defaults to 'fuzzy_with_index_bias'. The example below will use the native fzf -- sorter instead. By default, this function returns `nil`.