unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Matt Armstrong <matt@rfc20.org>
To: notmuch@notmuchmail.org
Cc: Matt Armstrong <matt@rfc20.org>
Subject: [PATCH] Fix author-scan.sh on BSD systems.
Date: Sat, 13 Feb 2021 10:22:43 -0800	[thread overview]
Message-ID: <20210213182243.94288-1-matt@rfc20.org> (raw)

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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/devel/author-scan.sh b/devel/author-scan.sh
index 2d9c4af8..23854f39 100644
--- a/devel/author-scan.sh
+++ b/devel/author-scan.sh
@@ -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
-- 
2.30.0

             reply	other threads:[~2021-07-30 23:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-13 18:22 Matt Armstrong [this message]
2021-08-03 20:35 ` [PATCH] Fix author-scan.sh on BSD systems Tomi Ollila
2021-08-04  1:47 ` David Bremner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210213182243.94288-1-matt@rfc20.org \
    --to=matt@rfc20.org \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).