]> git.notmuchmail.org Git - notmuch/commitdiff
Fix author-scan.sh on BSD systems.
authorMatt Armstrong <matt@rfc20.org>
Sat, 13 Feb 2021 18:22:43 +0000 (10:22 -0800)
committerDavid Bremner <david@tethera.net>
Tue, 3 Aug 2021 23:26:36 +0000 (20:26 -0300)
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.

devel/author-scan.sh

index 2d9c4af8deb34f844013321bb9ad957ba619c48c..23854f391a1f76fefce19c579de00d059c4d0b3c 100644 (file)
@@ -5,7 +5,7 @@ AUTHOR_EXCLUDE='uncrustify'
 # based on the FSF guideline, for want of a better idea.
 THRESHOLD=15
 
-git ls-files | grep -v -e "$FILE_EXCLUDE" | xargs -n 1 -d \\n \
+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