-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Commit search breaks when looking for opening square bracket "[" #28269
Comments
FYI, keywords are used here which lacked some checks. gitea/modules/git/repo_commit.go Lines 149 to 151 in 8b45a4d
|
Hi, can I work on this? |
The default behavior of If we want our keywords to be interpreted as 'strings', we should use I'm not sure if using regular expressions was the intended behavior previously. |
Fixes #28269 The [default behavior](https://git-scm.com/docs/git-log#Documentation/git-log.txt---basic-regexp) of --grep in git log is to interpret the keyword as a regular expression. This causes the search to fail in the cases where the search keyword contains a `[`, since `[` is a special character used in grep. If we want our keywords to be interpreted as 'strings', we should use [-F flag](https://git-scm.com/docs/git-log#Documentation/git-log.txt---basic-regexp).
Fixes go-gitea#28269 The [default behavior](https://git-scm.com/docs/git-log#Documentation/git-log.txt---basic-regexp) of --grep in git log is to interpret the keyword as a regular expression. This causes the search to fail in the cases where the search keyword contains a `[`, since `[` is a special character used in grep. If we want our keywords to be interpreted as 'strings', we should use [-F flag](https://git-scm.com/docs/git-log#Documentation/git-log.txt---basic-regexp).
Backport #28744 by @me-heer Fixes #28269 The [default behavior](https://git-scm.com/docs/git-log#Documentation/git-log.txt---basic-regexp) of --grep in git log is to interpret the keyword as a regular expression. This causes the search to fail in the cases where the search keyword contains a `[`, since `[` is a special character used in grep. If we want our keywords to be interpreted as 'strings', we should use [-F flag](https://git-scm.com/docs/git-log#Documentation/git-log.txt---basic-regexp). Co-authored-by: Mihir Joshi <mihir67mj@gmail.com>
Fixes go-gitea#28269 The [default behavior](https://git-scm.com/docs/git-log#Documentation/git-log.txt---basic-regexp) of --grep in git log is to interpret the keyword as a regular expression. This causes the search to fail in the cases where the search keyword contains a `[`, since `[` is a special character used in grep. If we want our keywords to be interpreted as 'strings', we should use [-F flag](https://git-scm.com/docs/git-log#Documentation/git-log.txt---basic-regexp).
Fixes go-gitea#28269 The [default behavior](https://git-scm.com/docs/git-log#Documentation/git-log.txt---basic-regexp) of --grep in git log is to interpret the keyword as a regular expression. This causes the search to fail in the cases where the search keyword contains a `[`, since `[` is a special character used in grep. If we want our keywords to be interpreted as 'strings', we should use [-F flag](https://git-scm.com/docs/git-log#Documentation/git-log.txt---basic-regexp).
Description
When trying to filter commits on a repo where the commit message have the type of commit enclosed in square brackets, e.g. "[build] Update libraries to next mayor version", the search doesn't behave as expected.
The different cases I tried were:
Gitea Version
1.21.0
Can you reproduce the bug on the Gitea demo site?
Yes
Log Gist
No response
Screenshots
When you search for "[" shows this error page
Git Version
2.40.1, Wire Protocol Version 2 Enabled
Operating System
Debian GNU/Linux 11
How are you running Gitea?
gitea/gitea:1.21.0 Docker image
Database
None
The text was updated successfully, but these errors were encountered: