0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2025-01-10 16:40:22 -05:00
forgejo/templates/repo
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
..
actions
branch ui: update pull request icons (#4455) 2024-07-16 14:38:46 +00:00
cite Remove APA as cite format 2024-07-20 15:48:57 +02:00
code
diff ui: improve button gap consistency in repos (#4365) 2024-07-07 03:21:58 +00:00
editor
find
graph
issue [BUG] Ensure all filters are persistent in issue filters 2024-08-06 17:12:10 +02:00
migrate ui: refactor repo migration items 2024-07-27 16:35:48 +05:00
projects
pulls
release Implement external assets 2024-07-29 20:35:55 +02:00
settings
tag
wiki
activity.tmpl
admin_flags.tmpl
blame.tmpl ui(blame): remove broken padding (#4318) 2024-07-04 11:46:31 +00:00
branch_dropdown.tmpl
clone_buttons.tmpl
clone_script.tmpl
code_frequency.tmpl
commit_load_branches_and_tags.tmpl
commit_page.tmpl feat(performance): remove BranchName in /:owner/:repo/commit/:commit 2024-08-08 22:29:42 +02:00
commit_status.tmpl
commit_statuses.tmpl
commits.tmpl
commits_list.tmpl
commits_list_small.tmpl
commits_search_dropdown.tmpl
commits_table.tmpl
contributors.tmpl
create.tmpl feat(i18n): allow different translations of creation links and titles (#4829) 2024-08-07 16:54:05 +00:00
create_helper.tmpl
empty.tmpl
file_info.tmpl [UI] Do not include trailing EOL character when counting lines 2024-08-06 04:36:57 +02:00
flags.tmpl
forks.tmpl
graph.tmpl
header.tmpl feat(UI): add package counter to repo/user/org overview pages 2024-07-31 12:40:24 +02:00
header_fork.tmpl
home.tmpl
icon.tmpl
latest_commit.tmpl
navbar.tmpl
packages.tmpl
pulse.tmpl feat(UI): fix links, add labels for releases on repo activity page 2024-08-02 07:56:03 +02:00
recent_commits.tmpl
release_tag_header.tmpl
search.tmpl
search_name.tmpl
shabox_badge.tmpl
star_unstar.tmpl
sub_menu.tmpl
unicode_escape_prompt.tmpl
upload.tmpl
user_cards.tmpl ui: refactor user-cards as a grid 2024-08-02 19:27:31 +05:00
view_file.tmpl accessibility: anchor elements' missing href added (#4375) 2024-07-08 17:32:59 +00:00
view_list.tmpl feat(UI): add links to icons in repository file list 2024-08-01 13:32:01 +02:00
watch_unwatch.tmpl
watchers.tmpl