unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Tomi Ollila <tomi.ollila@iki.fi>
To: Matt Armstrong <matt@rfc20.org>, notmuch@notmuchmail.org
Subject: Re: [PATCH] Fix author-scan.sh on BSD systems.
Date: Tue, 03 Aug 2021 23:35:23 +0300	[thread overview]
Message-ID: <m2sfzqjmgk.fsf@guru.guru-group.fi> (raw)
In-Reply-To: <20210213182243.94288-1-matt@rfc20.org>

On Sat, Feb 13 2021, Matt Armstrong wrote:

> 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 \

LGTM. David will know if this works for the task this is needed :D

Tomi

>                                                    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-08-03 20:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-13 18:22 [PATCH] Fix author-scan.sh on BSD systems Matt Armstrong
2021-08-03 20:35 ` Tomi Ollila [this message]
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=m2sfzqjmgk.fsf@guru.guru-group.fi \
    --to=tomi.ollila@iki.fi \
    --cc=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).