Beyond coding. We forge. https://forgejo.org
Find a file
emilylange c1f85ce27b
feat(performance): remove BranchName in /:owner/:repo/commit/:commit
`BranchName` provides the nearest branch of the requested `:commit`.

It's plenty fast on smaller repositories.
On larger repositories like nixpkgs, however, this can easily take 2-3
seconds on a modern machine on a NVMe.

For context, at the time of writing, nixpkgs has over 650k commits and
roughly 250 branches.

`BranchName` is used once in the whole view:
The cherry-pick target branch default selection.

And I believe that's a logic error, which is why this patch is so small.

The nearest branch of a given commit will always be a branch the commit
is already part of. The branch you most likely *don't* want to
cherry-pick to.

Sure, one can technically cherry-pick a commit onto the same branch, but
that simply results in an empty commit.

I don't believe this is intended and even less so worth the compute.

Instead, the cherry-pick branch selection suggestion now always uses
the default branch, which used to be the fallback.

If a user wants to know which branches contain the given commit,
`load-branches-and-tags` exists and should be used instead.

Also, to add insult to injury, `BranchName` was calculated for both
logged-in and not logged-in users, despite its only consumer, the
cherry-pick operation, only being rendered when a given user has
write/commit permissions.

But this isn't particularly surprising, given this happens a lot in
Forgejo's codebase.
2024-08-08 22:29:42 +02:00
.devcontainer
.forgejo Update renovate to v38.21.3 2024-08-08 08:05:32 +00:00
assets Update module golang.org/x/crypto to v0.26.0 (license update) 2024-08-08 08:15:29 +02:00
build
cmd
contrib Switch to FORGEJO_WORK_DIR in the systemd service configuration file (#4850) 2024-08-06 14:56:13 +00:00
custom/conf Revert "Open telemetry integration (#3972)" 2024-08-07 11:22:43 +02:00
docker
models Adjust codespell config + make it fix few typos which sneaked in since addition of codespell support (#4857) 2024-08-08 16:07:35 +00:00
modules Adjust codespell config + make it fix few typos which sneaked in since addition of codespell support (#4857) 2024-08-08 16:07:35 +00:00
options i18n: update of translations from Weblate (#4783) 2024-08-08 07:16:13 +00:00
public
release-notes Adjust codespell config + make it fix few typos which sneaked in since addition of codespell support (#4857) 2024-08-08 16:07:35 +00:00
releases/images
routers feat(performance): remove BranchName in /:owner/:repo/commit/:commit 2024-08-08 22:29:42 +02:00
services feat: access ActivityPub client through interfaces to facilitate mocking in unit tests (#4853) 2024-08-07 05:45:24 +00:00
templates feat(performance): remove BranchName in /:owner/:repo/commit/:commit 2024-08-08 22:29:42 +02:00
tests Adjust codespell config + make it fix few typos which sneaked in since addition of codespell support (#4857) 2024-08-08 16:07:35 +00:00
tools Adjust codespell config + make it fix few typos which sneaked in since addition of codespell support (#4857) 2024-08-08 16:07:35 +00:00
web_src Merge pull request '[UI] Add background to reactions on hover' (#4836) from gusted/forgejo-reaction-bg into forgejo 2024-08-06 09:54:28 +00:00
.air.toml
.deadcode-out feat: access ActivityPub client through interfaces to facilitate mocking in unit tests (#4853) 2024-08-07 05:45:24 +00:00
.dockerignore
.editorconfig
.envrc
.eslintrc.yaml
.gitattributes
.gitignore
.gitmodules
.gitpod.yml
.golangci.yml Revert "Open telemetry integration (#3972)" 2024-08-07 11:22:43 +02:00
.ignore
.markdownlint.yaml
.npmrc
.release-notes-assistant.yaml
.spectral.yaml
.yamllint.yaml
BSDmakefile
build.go
CODEOWNERS Remove dachary from CODEOWNERS 2024-08-05 18:12:11 +00:00
CONTRIBUTING.md
DCO
Dockerfile
Dockerfile.rootless
flake.lock
flake.nix
go.mod Update module golang.org/x/crypto to v0.26.0 2024-08-08 00:03:21 +00:00
go.sum Update module golang.org/x/crypto to v0.26.0 2024-08-08 00:03:21 +00:00
LICENSE
main.go
Makefile Update renovate to v38.21.3 2024-08-08 08:05:32 +00:00
package-lock.json Update dependency tailwindcss to v3.4.8 2024-08-08 00:02:42 +00:00
package.json Update dependency tailwindcss to v3.4.8 2024-08-08 00:02:42 +00:00
playwright.config.js
poetry.lock Lock file maintenance 2024-08-05 02:06:16 +00:00
poetry.toml
pyproject.toml Adjust codespell config + make it fix few typos which sneaked in since addition of codespell support (#4857) 2024-08-08 16:07:35 +00:00
README.md
release-notes-assistant.sh
RELEASE-NOTES.md Adjust codespell config + make it fix few typos which sneaked in since addition of codespell support (#4857) 2024-08-08 16:07:35 +00:00
renovate.json chore(renovate): add labels and reviewer to renovate updates 2024-08-08 11:42:32 +02:00
stylelint.config.js
tailwind.config.js Adjust codespell config + make it fix few typos which sneaked in since addition of codespell support (#4857) 2024-08-08 16:07:35 +00:00
vitest.config.js
webpack.config.js

Welcome to Forgejo

Hi there! Tired of big platforms playing monopoly? Providing Git hosting for your project, friends, company or community? Forgejo (/for'd͡ʒe.jo/ inspired by forĝejo the Esperanto word for forge) has you covered with its intuitive interface, light and easy hosting and a lot of builtin functionality.

Forgejo was created in 2022 because we think that the project should be owned by an independent community. If you second that, then Forgejo is for you! Our promise: Independent Free/Libre Software forever!

What does Forgejo offer?

If you like any of the following, Forgejo is literally meant for you:

  • Lightweight: Forgejo can easily be hosted on nearly every machine. Running on a Raspberry? Small cloud instance? No problem!
  • Project management: Besides Git hosting, Forgejo offers issues, pull requests, wikis, kanban boards and much more to coordinate with your team.
  • Publishing: Have something to share? Use releases to host your software for download, or use the package registry to publish it for docker, npm and many other package managers.
  • Customizable: Want to change your look? Change some settings? There are many config switches to make Forgejo work exactly like you want.
  • Powerful: Organizations & team permissions, CI integration, Code Search, LDAP, OAuth and much more. If you have advanced needs, Forgejo has you covered.
  • Privacy: From update checker to default settings: Forgejo is built to be privacy first for you and your crew.
  • Federation: (WIP) We are actively working to connect software forges with each other through ActivityPub, and create a collaborative network of personal instances.

Learn more

Dive into the documentation, subscribe to releases and blog post on our website, find us on the Fediverse or hop into our Matrix room if you have any questions or want to get involved.

Get involved

If you are interested in making Forgejo better, either by reporting a bug or by changing the governance, please take a look at the contribution guide.