From b19a3fb878882232a29920525f5cf5cb0eca3e42 Mon Sep 17 00:00:00 2001 From: Mateusz Hawrus <48822818+nieomylnieja@users.noreply.github.com> Date: Wed, 7 Feb 2024 12:57:45 +0100 Subject: [PATCH] chore: Interpret git log grep pattern as literal string (#264) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Motivation Commits which had special regex characters, like square braces, were causing the `git log --grep ` 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). --- .github/scripts/release-notes.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/release-notes.sh b/.github/scripts/release-notes.sh index 889159776..3c9e4886c 100755 --- a/.github/scripts/release-notes.sh +++ b/.github/scripts/release-notes.sh @@ -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"