mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-27 21:27:58 +01:00
5734d8bd32
BSD xargs does not have the -d option. Here we use tr to convert newlines to NUL characters, then pass -0 to xargs (which BSD does support). I looked at passing -z to 'git ls-files', but I did not find a BSD grep option to turn on NUL deliminted line processing.
11 lines
425 B
Bash
11 lines
425 B
Bash
#!/bin/sh
|
|
|
|
FILE_EXCLUDE='corpora'
|
|
AUTHOR_EXCLUDE='uncrustify'
|
|
# based on the FSF guideline, for want of a better idea.
|
|
THRESHOLD=15
|
|
|
|
git ls-files | grep -v -e "$FILE_EXCLUDE" | tr '\n' '\0' | xargs -0 -n 1 \
|
|
git blame -w --line-porcelain -- | \
|
|
sed -n "/$AUTHOR_EXCLUDE/d; s/^[aA][uU][tT][hH][Oo][rR] //p" | \
|
|
sort -fd | uniq -ic | awk "\$1 >= $THRESHOLD" | sort -nr
|