From: Jan Tulak <jtulak@redhat.com>
To: "Chinner, Dave" <david@fromorbit.com>
Cc: linux-xfs <linux-xfs@vger.kernel.org>
Subject: Re: [PATCH 0/2] xfsdump whitespace changes
Date: Mon, 5 Nov 2018 11:15:34 +0100 [thread overview]
Message-ID: <CACj3i73fMu64uxrhrGTyP0k4a7Q4c1veUbJnviT7NddSzueLvQ@mail.gmail.com> (raw)
In-Reply-To: <20181102223435.GE19305@dastard>
On Fri, Nov 2, 2018 at 11:34 PM Dave Chinner <david@fromorbit.com> wrote:
>
> On Fri, Nov 02, 2018 at 12:43:18PM +0100, Jan Tulak wrote:
> > On Fri, Nov 2, 2018 at 2:36 AM Dave Chinner <david@fromorbit.com> wrote:
> > > On Thu, Nov 01, 2018 at 12:01:28PM +0100, Jan Tulak wrote:
> > > However, it's is the same change as what you originally posted to a
> >
> > Yes, it is the same thing, with changes where I found something
> > misaligned on top.
> >
> > > git tree, then it needs revision. basically, most of the change was
> > > converting vertically aligned function call parameters to use tabs,
> > > and that broke the vertical alignment.
> >
> > It is "s/ /\t/" limited to the beginning of the line.
>
> You mean 's/^ /\t/'?
Yes, but in multiple iterations to get \t, \t\t, \t\t\t, ...
[snip]
> > > I'd suggest that this is the least of the whitespace sins of
> > > xfsdump. yes, it's easy to script, but I don't think it's the right
> > > thing to do. The biggest problems I think we need to start with are:
> > >
> > > - reformat all the function definitions according to common XFS style
> > > - get rid of all the "( foo )" style white space aroudn parenthesis
> >
> > I already started working on it. It is too complex for awk/sed, so I'm
> > trying to find some better way through IDEs with autoformatting
> > capabilities.
>
> It should be relatively straight forward with sed. e.g. off the top
> of my head, stripping the space after "(" is this expression:
>
> $ echo "foo( bar" | sed -e 's/\([[:alnum:]](\) \([[:alnum:]]\)/\1\2/'
> foo(bar
> $
I tried something similar and the result was not ideal - it worked ok
for common cases, but not always.
>
> /me is slightly worried that he can now write non-trivial line noise
> in sed that does the right thing first go....
>
> Another option is coccinelle - it was specifically designed to do
> such semantic transformations to C code:
Thanks for the tip, I will look at it.
Cheers,
Jan
--
Jan Tulak
next prev parent reply other threads:[~2018-11-05 19:34 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-01 11:01 [PATCH 0/2] xfsdump whitespace changes Jan Tulak
2018-11-01 11:01 ` [PATCH 1/2] xfsdump: remove trailing whitespaces Jan Tulak
2018-11-01 16:46 ` Eric Sandeen
2018-11-02 1:36 ` [PATCH 0/2] xfsdump whitespace changes Dave Chinner
2018-11-02 11:43 ` Jan Tulak
2018-11-02 16:54 ` Jan Tulak
2018-11-02 22:57 ` Dave Chinner
2018-11-05 10:17 ` Jan Tulak
2018-11-02 22:34 ` Dave Chinner
2018-11-05 10:15 ` Jan Tulak [this message]
2018-11-05 11:48 ` Dave Chinner
2018-11-05 12:25 ` Jan Tulak
2018-11-05 21:52 ` Dave Chinner
2018-11-08 17:39 ` Jan Tulak
2018-11-09 1:04 ` Dave Chinner
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=CACj3i73fMu64uxrhrGTyP0k4a7Q4c1veUbJnviT7NddSzueLvQ@mail.gmail.com \
--to=jtulak@redhat.com \
--cc=david@fromorbit.com \
--cc=linux-xfs@vger.kernel.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.
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).