]> source.dussan.org Git - gitea.git/commit
Add -F to commit search to treat keywords as strings (#28744) (#28748)
authorGiteabot <teabot@gitea.io>
Wed, 10 Jan 2024 20:29:01 +0000 (04:29 +0800)
committerGitHub <noreply@github.com>
Wed, 10 Jan 2024 20:29:01 +0000 (21:29 +0100)
commitf220f4231af35150eed910cbdc44fac8f85cdfb3
tree70c3cf2f61cbe3c6843c829b39b96150f8b8ff47
parentbce27d0a31b42a68cc3faa52dc0fb23b612b02de
Add -F to commit search to treat keywords as strings (#28744) (#28748)

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>
modules/git/repo_commit.go