From: Patrick Oppenlander <patrick.oppenlander@gmail.com>
To: musl@lists.openwall.com
Cc: Jules Maselbas <jmaselbas@kalray.eu>
Subject: Re: [musl] [PATCH 1/2] tools: Add a script to remove trailing spaces
Date: Wed, 4 May 2022 16:06:44 +1000 [thread overview]
Message-ID: <CAEg67GnsDna_oxotPMpCWTbnYpoHmcw1QtHPVuT+G5g=8Nyc2w@mail.gmail.com> (raw)
In-Reply-To: <20220503155655.11222-1-jmaselbas@kalray.eu>
On Wed, May 4, 2022 at 1:57 AM Jules Maselbas <jmaselbas@kalray.eu> wrote:
>
> Add the remove-trailing-space.sh script, it will only consider files
> tracked by git. Optionaly accept arguments to select the affected path.
>
> Signed-off-by: Jules Maselbas <jmaselbas@kalray.eu>
> ---
> tools/remove-trailing-space.sh | 2 ++
> 1 file changed, 2 insertions(+)
> create mode 100755 tools/remove-trailing-space.sh
>
> diff --git a/tools/remove-trailing-space.sh b/tools/remove-trailing-space.sh
> new file mode 100755
> index 00000000..a8b0056a
> --- /dev/null
> +++ b/tools/remove-trailing-space.sh
> @@ -0,0 +1,2 @@
> +#!/bin/sh
> +git grep '[[:space:]]$' -- $@ | sed 's/:.*//' | uniq | xargs sed -i 's/[[:space:]]\+$//'
There's a --name-only option you can give to git grep, so I think you
can simplify this to:
git grep --name-only '[[:space:]]$' | xargs sed -i 's/[[:space:]]\+$//'
Patrick
next prev parent reply other threads:[~2022-05-04 6:07 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-03 15:56 Jules Maselbas
2022-05-03 15:56 ` [musl] [PATCH 2/2] Remove trailing whitespaces tree-wide Jules Maselbas
2022-05-03 16:17 ` Jeffrey Walton
2022-05-03 17:14 ` Rich Felker
2022-05-03 16:29 ` Khem Raj
2022-05-03 16:30 ` [musl] [PATCH 1/2] tools: Add a script to remove trailing spaces Khem Raj
2022-05-04 6:06 ` Patrick Oppenlander [this message]
2022-05-04 8:20 ` Jules Maselbas
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAEg67GnsDna_oxotPMpCWTbnYpoHmcw1QtHPVuT+G5g=8Nyc2w@mail.gmail.com' \
--to=patrick.oppenlander@gmail.com \
--cc=jmaselbas@kalray.eu \
--cc=musl@lists.openwall.com \
/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://git.vuxu.org/mirror/musl/
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 NNTP newsgroup(s).