Re: [PATCH 0/2] xfsdump whitespace changes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Nov 08, 2018 at 06:39:21PM +0100, Jan Tulak wrote:
> On Mon, Nov 5, 2018 at 10:53 PM Dave Chinner <david@xxxxxxxxxxxxx> wrote:
> >
> > On Mon, Nov 05, 2018 at 01:25:45PM +0100, Jan Tulak wrote:
> > > On Mon, Nov 5, 2018 at 12:48 PM Dave Chinner <david@xxxxxxxxxxxxx> wrote:
> > > >
> > > > On Mon, Nov 05, 2018 at 11:15:34AM +0100, Jan Tulak wrote:
> > > > > On Fri, Nov 2, 2018 at 11:34 PM Dave Chinner <david@xxxxxxxxxxxxx> 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@xxxxxxxxxxxxx> 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, ...
> > > >
> > > > Which is handled by this regex: 's/^\(\t*\)*    /\1\t/'
> > > >
> > > > In this case, I'm using "*", which means "match zero or more of the
> > > > preceding expression" - which in this case is \t. That regex is
> > > > enclosed in \(...\) to group the result, which is then back
> > > > referenced in the output expression by \1 (first group backref).
> > > >
> > > > Regexes are extremely and flexible once you've learnt how the
> > > > multiple object matching rules work.
> > >
> > > I know. But I don't see how your regex would take the number of
> > > four-space groups and inserted the same number of \t,
> >
> > I thought you were asking about having multiple tabs preceding
> > the "4 space group". If you simply want to change all 4 space
> > groups, it's 's/\(    \)/\t/g':
> >
> 
> [snip]
> 
> Thanks, but I know regular expressions, even if I usually don't get a
> nontrivial expression on a first try. :-D
> 
> Anyway, how about this? I pushed it into a new branch (style-nov-8th)
> https://github.com/jtulak/xfsdump/tree/style-nov-8th
> (git clone --single-branch -b style-nov-8th
> https://github.com/jtulak/xfsdump.git)
> 
> It is now in 16 patches, split usually one change at a time. Three of
> them are over 500k in size, so I will need to cut them somehow into
> more parts before sending them into the mailing list.

Split them by dump/restore/inventory/common directories.

> But I ended up
> with a small script set that does it all, including the creation of
> commits, so I don't have to deal with conflicts if I will need to
> change anything.
> 
> Btw, I wonder if these formatting scripts could be useful if I push
> them somewhere publicly... About 2/3 are sed replacements, the last
> third are gradually stricter configurations for Uncrustify
> (http://uncrustify.sourceforge.net/, available in distro repos).

The scripts used for the transfomation should be documented in the
the commit messages. e.g:

https://git.kernel.org/pub/scm/fs/xfs/xfsprogs-dev.git/commit/?id=37b3b4d6c38aaf501dd7714d9670bff4ac282923

Cheers,

Dave.
-- 
Dave Chinner
david@xxxxxxxxxxxxx



[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux