Skip to content

Commit

Permalink
chore: Interpret git log grep pattern as literal string (#264)
Browse files Browse the repository at this point in the history
## Motivation

Commits which had special regex characters, like square braces, were
causing the `git log --grep <pattern>` to fail.
We need to interpret these as literal strings, thus `-F` flag, which as
per `man git log` says:
> -F, --fixed-strings
Consider the limiting patterns to be fixed strings (don’t interpret
pattern as a regular expression).
  • Loading branch information
nieomylnieja authored Feb 7, 2024
1 parent f1cb3c3 commit b19a3fb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion .github/scripts/release-notes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ while IFS= read -r line; do
continue
fi
commit_msg="${BASH_REMATCH[1]}"
commit_body=$(git log --grep "$commit_msg" -n1 --pretty="%b")
commit_body=$(git log -F --grep "$commit_msg" -n1 --pretty="%b")

add_notes() {
local notes="$1"
Expand Down

0 comments on commit b19a3fb

Please sign in to comment.