Re: [dev] [sbase][RFC] patch: whitespace patches

From: Mattias Andrée <maandree_AT_kth.se>
Date: Thu, 25 Feb 2016 13:47:45 +0100

On Thu, 25 Feb 2016 13:29:07 +0100
v4hn <me_AT_v4hn.de> wrote:

> On Thu, Feb 25, 2016 at 11:24:25AM +0000, Dimitris
> Papastamos wrote:
> > On Wed, Feb 24, 2016 at 08:54:13PM +0100, Mattias
> > Andrée wrote:
> > > I'm thinking about introducing an extension to the
> > > standard: -w. When this flag is used, patch will
> > > verify that the patchfile only changes whitespace in
> > > the file.
> > >
> > > 1) Do you think this should be a flag or a separate
> > > tool?
> >
> > Sounds like it could be a flag.
>
> Sounds useless to me. What counts as whitespace change?
> `if(x){ \n` -> `if(x){\n`, ok,
> `\tif(x){\n` -> ` if(x){\n`, in python and haskell
> probably not, `if(x){\n` -> `if(x) {\n`, seems simple
> enough, `printf("%d",x);\n` -> `printf("% d",x);\n`,
> that's no simple whitespace change, not to talk about the
> infamous bumblebee patch `rm -rf /usr /share` -> `rm
> -rf /usr/share`
>
> This does not belong into standard patch.

Perhaps it is best not to include it. But what about
a flag that sends to old file and the new file to
a tool that can test if the patch is acceptable?
Then you can select a tool that can valdiate the
patch for syntax, and it could be used for any type
of test.

>
> > > 2) Should it be able to do a dry run, would be
> > > another flag that can be used independently of -w?
> >
> > Yes it would be nice to support a dry run flag
> > regardless of whether -w is specified or not.
>
> gnu patch supports --dry-run. It probably makes sense
> to support this flag either way.
>
>
> v4hn


Received on Thu Feb 25 2016 - 13:47:45 CET

This archive was generated by hypermail 2.3.0 : Thu Feb 25 2016 - 14:00:08 CET