Files
proxmark3/filter_git_blame.sh
Henry Gabryjelski 4d7b647050 Resolve github codepilot recommendations
* Shell script NOT updated to use an atomic rename after writing to temp file.   Don't commit if it's not right.
* Shell script `set -e` is now `set -euo pipefail`
* Shell script uses short-form options for `sort`
* Three typos fixed in markdown
* .gitignore updated to ignore codeql trash
2026-06-13 17:45:46 -07:00

34 lines
803 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
git log --format='%H%n%B%x00' | awk -v RS='\0' '
BEGIN {
i = 0
patterns[i++] = "^make style$"
patterns[i++] = "^make miscchecks$"
patterns[i++] = "^cppcheck"
}
{
if (!match($0, /^\n?([0-9A-Fa-f]{40})\n(.*)$/, matches)) next
# Only print once, even if matches multiple table entries
do_print = 0
# message ... remove trailing whitepace and blank lines
msg = matches[2]
sub(/( *(\r?\n))+$/, "", msg)
# try each pattern in the table
for (i in patterns) {
if (msg ~ patterns[i]) {
do_print = 1
}
}
if (do_print) {
print matches[1]
}
}
' | sort -u -f > .git-blame-ignore-revs