mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Jules Maselbas <jmaselbas@kalray.eu>
To: Patrick Oppenlander <patrick.oppenlander@gmail.com>
Cc: musl@lists.openwall.com
Subject: Re: [musl] [PATCH 1/2] tools: Add a script to remove trailing spaces
Date: Wed, 4 May 2022 10:20:40 +0200	[thread overview]
Message-ID: <20220504082040.GA10082@tellis.lin.mbt.kalray.eu> (raw)
In-Reply-To: <CAEg67GnsDna_oxotPMpCWTbnYpoHmcw1QtHPVuT+G5g=8Nyc2w@mail.gmail.com>

Hi Patrick,

On Wed, May 04, 2022 at 04:06:44PM +1000, Patrick Oppenlander wrote:
> 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:
Thanks, I've looked for this kind of option but failed to found it :)

> git grep --name-only '[[:space:]]$' | xargs sed -i 's/[[:space:]]\+$//'
This is much better :)

> Patrick
> 
> 





      reply	other threads:[~2022-05-04  8:21 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
2022-05-04  8:20   ` Jules Maselbas [this message]

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=20220504082040.GA10082@tellis.lin.mbt.kalray.eu \
    --to=jmaselbas@kalray.eu \
    --cc=musl@lists.openwall.com \
    --cc=patrick.oppenlander@gmail.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).