Improve git blame by ignoring certain commits
This commit is contained in:
1 parent
b8b994bfd0
commit
59c0ed976d
3 files changed
+899
No files matched your search
Executable
+32
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
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 --unique --ignore-case > .git-blame-ignore-revs
|
||||
Reference in new issue
Block a user