[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75VfQq=RkjyZQsc-PHLTLRCzXovm-D_Z+Pp3A6vWGA-GKug@mail.gmail.com>
Date: Wed, 9 Jun 2021 13:30:53 +0300
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: "Leizhen (ThunderTown)" <thunder.leizhen@...wei.com>
Cc: Joe Perches <joe@...ches.com>, Andy Shevchenko <andy@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Andrew Morton <akpm@...ux-foundation.org>,
linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/1] lib: remove leading spaces before tabs
On Wed, Jun 9, 2021 at 9:21 AM Leizhen (ThunderTown)
<thunder.leizhen@...wei.com> wrote:
> On 2021/6/9 13:15, Leizhen (ThunderTown) wrote:
> > On 2021/6/9 0:03, Joe Perches wrote:
> >> On Tue, 2021-06-08 at 17:00 +0800, Leizhen (ThunderTown) wrote:
> >>> On 2021/6/8 16:44, Andy Shevchenko wrote:
> >>>> On Tue, Jun 8, 2021 at 10:14 AM Zhen Lei <thunder.leizhen@...wei.com> wrote:
> >>>>>
> >>>>> 1) Run the following command to find and remove the leading spaces before
> >>>>> tabs:
> >>>>> find lib/ -type f | xargs sed -r -i 's/^[ ]+\t/\t/'
> >>>>
> >>>> Hint for the future, try to use what Git provides, for example `git
> >>>> ls-files -- lib/`.
> >>>
> >>> Okay, thanks. I learned a new trick.
> >> For instance:
> >>
> >> $ git diff --stat lib
> >> $ git ls-files lib/ | \
> >> xargs ./scripts/checkpatch.pl --types=SPACE_BEFORE_TAB --fix-inplace
>
> I just tried it. It's too slow.
If checkpath accepts infinite positional arguments, then proper way of
use (that's how I do with simple perl regexps) is to
scripts/checkpatch.pl --types=SPACE_BEFORE_TAB --fix-inplace -- $(git
ls-files lib/)
Seems like we have a shell lesson :-)
> The command I used earlier, removing the line start match "^", can also do that.
>
> git ls-files lib/ | xargs sed -r -i 's/[ ]+\t/\t/'
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists