Open cosmoswafer opened 3 months ago
The root problem is that there is no "branch name" support on the web UI (and I guess there is no such support for other search engine/indexers).
So it could be an enhancement to introduce "current branch" support.
The root problem is that there is no "branch name" support on the web UI (and I guess there is no such support for other search engine/indexers).
IIRC the other code indexers will only index on the default branch, and GitHub also has the same behaviour, as if we allow searching on other/all branches our index will explode in size
I see. I’ve read the source code and found that the branch name is in the context. I thought there were some bugs because it doesn’t recognize the branch name. By the way, git grep should support searching by branch name, and the branch name is, in fact, part of the URL. Thus, I think technically we can pass the branch name from the URL to the code search box as another query parameter.
If we implemented search via git grep with branch name but other indexes will not support it. It's inconsistent between different indexes. Maybe it will result in confusing?
Description
When using the code search on another branch, Gitea doesn’t respect the branch name and only searches the default branch. I guess the search URL loses the branch name from the context because there is no related information passed together with the request.
Gitea Version
1.22.0
Can you reproduce the bug on the Gitea demo site?
Yes
Log Gist
No response
Screenshots
No response
Git Version
git version 2.44.2
Operating System
Gentoo
How are you running Gitea?
Running the executable binaries from github release. And I think it doesn't matter to this issue.
Database
MySQL/MariaDB