forgejo/templates
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
..
admin [UI] Fix admin layout 2024-07-30 23:35:22 +02:00
api/packages/pypi Update templates/api/packages/pypi/simple.tmpl 2024-04-12 16:43:30 +00:00
base feat(i18n): allow different translations of creation links and titles (#4829) 2024-08-07 16:54:05 +00:00
custom [FEAT] Repository flags 2024-02-05 16:09:42 +01:00
devtest Fix some URLs whose sub-path is missing (#31289) 2024-06-09 16:04:57 +02:00
explore [I18N] Injected updated time in translation string (#3837) 2024-05-20 18:47:35 +00:00
htmx [UI] Convert milestone to HTMX 2024-07-17 14:52:00 +02:00
mail Merge pull request '[SEC] Notify owner about TOTP enrollment' (#4704) from gusted/sec-more-totp into forgejo 2024-07-27 20:53:47 +00:00
org feat(i18n): allow different translations of creation links and titles (#4829) 2024-08-07 16:54:05 +00:00
package Arch packages implementation (#4785) 2024-08-04 06:16:29 +00:00
projects Merge pull request 'Replace gt-word-break with tw-break-anywhere' (#4102) from 0ko/forgejo:ui-replace-gt-word-break into forgejo 2024-06-11 10:39:03 +00:00
repo feat(performance): remove BranchName in /:owner/:repo/commit/:commit 2024-08-08 22:29:42 +02:00
shared [BUG] Ensure all filters are persistent in issue filters 2024-08-06 17:12:10 +02:00
status feat(quota): Quota enforcement 2024-08-02 11:10:34 +02:00
swagger Merge pull request '[gitea] week 2024-32 cherry pick (gitea/main -> forgejo)' (#4801) from earl-warren/wcp/2024-32 into forgejo 2024-08-06 05:47:20 +00:00
user feat(UI): add package counter to repo/user/org overview pages 2024-07-31 12:40:24 +02:00
webhook webhook: matrix access_token helper text 2024-04-16 08:59:56 +02:00
home.tmpl Add slogan config (#3752) 2024-06-07 17:12:48 +00:00
install.tmpl A few cosmetic improvements to the installation page (#4170) 2024-06-18 09:49:56 +00:00
post-install.tmpl [BRANDING] Custom loading animation for Forgejo 2024-02-05 16:02:13 +01:00