Re: [Dnsmasq-discuss] space two point eighty one

2020-03-08 Thread Geert Stappers
On Sun, Mar 08, 2020 at 05:40:13PM +, Simon Kelley wrote:
> On 05/03/2020 21:05, Geert Stappers wrote:
> > 
> >   ...  "Removed useless whitespace"  ...
> > 
> > 
> 
> I just spent a couple of hours playing with the options to GNU ident, to
> see if I could get it to clean up not just whitespace but also any
> identing other more subtle problems, on the grounds that if we're going
> to make a huge formatting commit, we should do it just once.
> 
> My conclusion is that there is some stuff in there that needs to be
> fixed, but I can't make ident work in a way where I'm happy to run it
> automatically. I therefore plan to do this.
> 
> 1) Run ident once over the code with the best options I have, then fix
> up the small amount of stuff it does which I don't like (mainly
> line-breaks). That should also remove trailing spaces and tabs and
> trailing blank lines from files. I'll use Geerts scripts to make sure.
> 
> 2) Commit that.
> 
> 3) Add git hooks to expand or similar to keep the whitespace stuff clean
> going forward.
> 
> This is not something I'm going  to do for 2.81, sorry Geert. It's too
> big a change for this late in the cycle.

Acknowlege on "no big change now".

Removing tailing white lines ( 
<1583615260-26446-1-git-send-email-stapp...@alpaca.gpm.stappers.nl> 
 http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/2020q1/013866.html )
will help us on the long run.  That is because `git diff --ignore-space-change`
does report removed lines. Removing the tailing white lines first, means
those changes(removals) wouldn't show up when we make further changes.


Regards
Geert Stappers
-- 
Silence is hard to parse

___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] space two point eighty one

2020-03-08 Thread Simon Kelley
On 05/03/2020 21:05, Geert Stappers wrote:

> `git diff` is huge, almost 22000 lines.  Yes, a huge clean-up.
> 
> 
> I love to see that in the 2.81 release of dnsmasq.
> 
>  git commit -am "Removed useless whitespace" --author "Geert Stappers 
> "
> 
> 

I just spent a couple of hours playing with the options to GNU ident, to
see if I could get it to clean up not just whitespace but also any
identing other more subtle problems, on the grounds that if we're going
to make a huge formatting commit, we should do it just once.

My conclusion is that there is some stuff in there that needs to be
fixed, but I can't make ident work in a way where I'm happy to run it
automatically. I therefore plan to do this.

1) Run ident once over the code with the best options I have, then fix
up the small amount of stuff it does which I don't like (mainly
line-breaks). That should also remove trailing spaces and tabs and
trailing blank lines from files. I'll use Geerts scripts to make sure.

2) Commit that.

3) Add git hooks to expand or similar to keep the whitespace stuff clean
going forward.

This is not something I'm going  to do for 2.81, sorry Geert. It's too
big a change for this late in the cycle.


Cheers,

Simon.




signature.asc
Description: OpenPGP digital signature
___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] space two point eighty one, take 2

2020-03-08 Thread john doe
On 3/8/2020 12:33 PM, Geert Stappers wrote:
> On Sat, Mar 07, 2020 at 10:01:30PM +0100, Geert Stappers wrote:
>> In-Reply-To: <1255b7ff-351f-46d7-f811-ac3373102...@thekelleys.org.uk>
>> On Thu, Mar 05, 2020 at 10:34:29PM +, Simon Kelley wrote:
>>> On 05/03/2020 21:05, Geert Stappers wrote:
 On Thu, Mar 05, 2020 at 09:46:21PM +0100, Geert Stappers wrote:
>
> I plea for removal of unneeded ' ' and '  '.
>
> That removal can be done with:
>   ... remove trailing white_space_only_lines ...
>
>   ... empty lines: sed --in-place -e 's/^[ \t]*$//' src/*.c   ...

 I love to see that in the 2.81 release of dnsmasq.

>>>
>>> The obvious problem with doing that is that for ever more, when I run
>> } "git blame" N lines will have the source "Removed useless whitespace".
>>
>> That valid point shouldn't be a big issue.
>> At least I think it can be mitigated.
>>
>> Now spliting previous change request into two parts:
>> * Removing trailing white_space_only_lines
>
> Done, see 
> http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/2020q1/013866.html
>
> Removed lines don't show up in `git blame`.
>
>
>> * Emptying the empty lines
>
> Execute:
>
>   sed --in-place -e 's/^[ \t]*$//' src/*.c src/*.h
>
>
>
> 
> $ git diff | wc
>   21923   78016  607091
> $ git diff | grep ^+ | grep -c -v ^+++
> 3053
> $ wc -l src/*.c src/*.h | tail -n 1
>   39474 totaal
> $ echo "3053 / 39474 * 100" | bc -l
> 7.73420479302832244000
> 
>
> To prevent that 8% of the lines in future `git blame`
> will distract us by reminding us on this clean-up.
>
> Execute:
>
>   git commit -am "Removed useless white space" --author="Simon Kelley 
> "
>
>
> 
> $ git blame src/arp.c | sed --silent -e 60,80p
> cc921df9 (Simon Kelley 2019-01-02 22:48:59 +  60)   if 
> (!IN6_ARE_ADDR_EQUAL(>addr.addr6, (struct in6_addr *)addrp))
> 11867dc2 (Simon Kelley 2015-12-23 16:15:58 +  61) continue;
> 11867dc2 (Simon Kelley 2015-12-23 16:15:58 +  62) }
> 11867dc2 (Simon Kelley 2015-12-23 16:15:58 +  63)
> 33702ab1 (Simon Kelley 2015-12-28 23:17:15 +  64)   if (arp->status 
> == ARP_EMPTY)
> 11867dc2 (Simon Kelley 2015-12-23 16:15:58 +  65) {
> 33702ab1 (Simon Kelley 2015-12-28 23:17:15 +  66)   /* existing 
> address, was negative. */
> 11867dc2 (Simon Kelley 2015-12-23 16:15:58 +  67)   arp->status = 
> ARP_NEW;
> 11867dc2 (Simon Kelley 2015-12-23 16:15:58 +  68)   arp->hwlen = 
> maclen;
> 11867dc2 (Simon Kelley 2015-12-23 16:15:58 +  69) memcpy(arp->hwaddr, 
> mac, maclen);
> 11867dc2 (Simon Kelley 2015-12-23 16:15:58 +  70) }
> 33702ab1 (Simon Kelley 2015-12-28 23:17:15 +  71)   else if 
> (arp->hwlen == maclen && memcmp(arp->hwaddr, mac, maclen) == 0)
> 33702ab1 (Simon Kelley 2015-12-28 23:17:15 +  72) /* Existing 
> entry matches - confirm. */
> 33702ab1 (Simon Kelley 2015-12-28 23:17:15 +  73) arp->status = 
> ARP_FOUND;
> 33702ab1 (Simon Kelley 2015-12-28 23:17:15 +  74)   else
> 33702ab1 (Simon Kelley 2015-12-28 23:17:15 +  75) continue;
> ced2a733 (Simon Kelley 2020-03-08 12:17:53 +0100  76)
> 11867dc2 (Simon Kelley 2015-12-23 16:15:58 +  77)   break;
> 11867dc2 (Simon Kelley 2015-12-23 16:15:58 +  78) }
> 11867dc2 (Simon Kelley 2015-12-23 16:15:58 +  79)
> 11867dc2 (Simon Kelley 2015-12-23 16:15:58 +  80)   if (!arp)
> 
>
>

Please use gitsend-email as you are known to be able to use it with the
'--reroll-count=..' for a new reroll.

So Simon knows which set of patches to consider.

--
John Doe

___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] space two point eighty one, take 2

2020-03-08 Thread Geert Stappers
On Sat, Mar 07, 2020 at 10:01:30PM +0100, Geert Stappers wrote:
> In-Reply-To: <1255b7ff-351f-46d7-f811-ac3373102...@thekelleys.org.uk>
> On Thu, Mar 05, 2020 at 10:34:29PM +, Simon Kelley wrote:
> > On 05/03/2020 21:05, Geert Stappers wrote:
> > > On Thu, Mar 05, 2020 at 09:46:21PM +0100, Geert Stappers wrote:
> > >>
> > >> I plea for removal of unneeded ' ' and ' '.
> > >>
> > >> That removal can be done with:
> > >>   ... remove trailing white_space_only_lines ...
> > >>
> > >>   ... empty lines: sed --in-place -e 's/^[ \t]*$//' src/*.c   ...
> > > 
> > > I love to see that in the 2.81 release of dnsmasq.
> > > 
> > 
> > The obvious problem with doing that is that for ever more, when I run
> } "git blame" N lines will have the source "Removed useless whitespace".
> 
> That valid point shouldn't be a big issue.
> At least I think it can be mitigated. 
> 
> Now spliting previous change request into two parts:
> * Removing trailing white_space_only_lines

Done, see 
http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/2020q1/013866.html

Removed lines don't show up in `git blame`.


> * Emptying the empty lines

Execute:

  sed --in-place -e 's/^[ \t]*$//' src/*.c src/*.h




$ git diff | wc
  21923   78016  607091
$ git diff | grep ^+ | grep -c -v ^+++
3053
$ wc -l src/*.c src/*.h | tail -n 1
  39474 totaal
$ echo "3053 / 39474 * 100" | bc -l
7.73420479302832244000


To prevent that 8% of the lines in future `git blame`
will distract us by reminding us on this clean-up.

Execute:

  git commit -am "Removed useless white space" --author="Simon Kelley 
"



$ git blame src/arp.c | sed --silent -e 60,80p
cc921df9 (Simon Kelley 2019-01-02 22:48:59 +  60) if 
(!IN6_ARE_ADDR_EQUAL(>addr.addr6, (struct in6_addr *)addrp))
11867dc2 (Simon Kelley 2015-12-23 16:15:58 +  61)   continue;
11867dc2 (Simon Kelley 2015-12-23 16:15:58 +  62)   }
11867dc2 (Simon Kelley 2015-12-23 16:15:58 +  63) 
33702ab1 (Simon Kelley 2015-12-28 23:17:15 +  64)   if (arp->status == 
ARP_EMPTY)
11867dc2 (Simon Kelley 2015-12-23 16:15:58 +  65)   {
33702ab1 (Simon Kelley 2015-12-28 23:17:15 +  66) /* existing address, 
was negative. */
11867dc2 (Simon Kelley 2015-12-23 16:15:58 +  67) arp->status = ARP_NEW;
11867dc2 (Simon Kelley 2015-12-23 16:15:58 +  68) arp->hwlen = maclen;
11867dc2 (Simon Kelley 2015-12-23 16:15:58 +  69) memcpy(arp->hwaddr, 
mac, maclen);
11867dc2 (Simon Kelley 2015-12-23 16:15:58 +  70)   }
33702ab1 (Simon Kelley 2015-12-28 23:17:15 +  71)   else if (arp->hwlen 
== maclen && memcmp(arp->hwaddr, mac, maclen) == 0)
33702ab1 (Simon Kelley 2015-12-28 23:17:15 +  72)   /* Existing entry 
matches - confirm. */
33702ab1 (Simon Kelley 2015-12-28 23:17:15 +  73)   arp->status = ARP_FOUND;
33702ab1 (Simon Kelley 2015-12-28 23:17:15 +  74)   else
33702ab1 (Simon Kelley 2015-12-28 23:17:15 +  75)   continue;
ced2a733 (Simon Kelley 2020-03-08 12:17:53 +0100  76) 
11867dc2 (Simon Kelley 2015-12-23 16:15:58 +  77)   break;
11867dc2 (Simon Kelley 2015-12-23 16:15:58 +  78) }
11867dc2 (Simon Kelley 2015-12-23 16:15:58 +  79) 
11867dc2 (Simon Kelley 2015-12-23 16:15:58 +  80)   if (!arp)



Regards
Geert Stappers
-- 
Silence is hard to parse


signature.asc
Description: PGP signature
___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] space two point eighty one, take 2

2020-03-07 Thread Geert Stappers
In-Reply-To: <1255b7ff-351f-46d7-f811-ac3373102...@thekelleys.org.uk>
On Thu, Mar 05, 2020 at 10:34:29PM +, Simon Kelley wrote:
> On 05/03/2020 21:05, Geert Stappers wrote:
> > On Thu, Mar 05, 2020 at 09:46:21PM +0100, Geert Stappers wrote:
> >>
> >> I plea for removal of unneeded ' ' and '   '.
> >>
> >> That removal can be done with:
> >>   ... remove trailing white_space_only_lines ...
> >>
> >>   ... empty lines: sed --in-place -e 's/^[ \t]*$//' src/*.c   ...
> > 
> > I love to see that in the 2.81 release of dnsmasq.
> > 
> 
> The obvious problem with doing that is that for ever more, when I run
} "git blame" N lines will have the source "Removed useless whitespace".

That valid point shouldn't be a big issue.
At least I think it can be mitigated. 

Now spliting previous change request into two parts:
* Removing trailing white_space_only_lines
* Emptying the empty lines


To be continued.


Regards
Geert Stappers
-- 
Silence is hard to parse

___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] space two point eighty one, (Git) alias

2020-03-07 Thread Geert Stappers
On Sat, Mar 07, 2020 at 12:21:39PM +0100, john doe wrote:
> On 3/7/2020 9:50 AM, Mark Grant wrote:
> > On Fri, 6 Mar 2020 23:38:46 +0100, Geert Stappers wrote:
> >> On Fri, Mar 06, 2020 at 02:53:43PM +, Mark Grant wrote:
> >>> On Thu, 5 Mar 2020 22:34:29 +, Simon Kelley wrote:
> 
>  The obvious problem with doing that is that for ever more, when I
> >>>} run "git blame" N lines will have the source "Removed useless 
> >>>whitespace".
> 
>  I have a feeling someone once posted a solution to that, but I
>  don't have time to trawl back and find it. Can anyone help?
> 
> >>> Does
> >>>   git blame -w
> >>> do the trick?
> >>>
> >>> Mark
> >>
> >> $ git blame -w src/arp.c | head -n 15
   ...
> >> $ git blame src/arp.c | head -n 15
   ...
> >
> > Thanks. So lines 7 & 12 show the desired behaviour (ignoring
> > whitespace-only changes).
> >
> > AFAICS there is no mechanism to make this the default behaviour within
> > git. A shell alias?
> >
> 
> I would go for Git alias.
> 

Tell us more.  Do something with:
>  I have a feeling someone once posted a solution to that, but I
>  don't have time to trawl back and find it. Can anyone help?



Regards
Geert Stappers
-- 
Silence is hard to parse

___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] space two point eighty one

2020-03-07 Thread john doe
On 3/7/2020 9:50 AM, Mark Grant wrote:
>
>
> On Fri, 6 Mar 2020 23:38:46 +0100, Geert Stappers wrote:
>
>> On Fri, Mar 06, 2020 at 02:53:43PM +, Mark Grant wrote:
>>> On Thu, 5 Mar 2020 22:34:29 +, Simon Kelley wrote:
 On 05/03/2020 21:05, Geert Stappers wrote:
> On Thu, Mar 05, 2020 at 09:46:21PM +0100, Geert Stappers
> wrote:
>>>   ...
>>
>> I plea for removal of unneeded ' ' and ' '.
>>
>> That removal can be done with:
>>
>> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc
>> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc
>> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc
>> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc
>> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc
>> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc
>> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc
>
> Numbers from output of `wc` increased.
>
>
>> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc
>> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc
>
> Output of `wc` is stable.
>
> At this point you probably want to do `git diff`
> and will see that trailing-space-only-lines are removed.
>
>
>> sed --in-place -e 's/^[ \t]*$//' src/*.c ; git diff | wc
>
> Lines that had only spaces or tabs got that white space removed.
>
>
>> sed --in-place -e 's/^[ \t]*$//' src/*.c ; git diff | wc
>> sed --in-place -e 's/^[ \t]*$//' src/*.c ; git diff | wc
>
> Output of `wc` is stable.
>
> `git diff` is huge, almost 22000 lines.  Yes, a huge clean-up.
>>
>> | $ git diff | wc
>> | 21782   77039  600247
>>
>> That 21782  became the "almost 22000 lines"
>>
>
> I love to see that in the 2.81 release of dnsmasq.
>
>  git commit -am "Removed useless whitespace" --author "Geert
> Stappers "
>
>

 The obvious problem with doing that is that for ever more, when I
 run "git blame" 22000 lines will have the source "Removed useless
 whitespace".
>>
>> Euh `git diff` has "context".
>> Better numbers in another email.
>>
 I have a feeling someone once posted a solution to that, but I
 don't have time to trawl back and find it. Can anyone help?

>>> Does
>>>   git blame -w
>>> do the trick?
>>>
>>> Mark
>>
>> stappers@paddy:~/src/dnsmasq
>> $ git blame -w src/arp.c | head -n 15
>> 2a8710ac (Simon Kelley 2020-01-05 16:40:06 +   1) /* dnsmasq is
>> Copyright (c) 2000-2020 Simon Kelley 11867dc2 (Simon Kelley
>> 2015-12-23 16:15:58 +   2) 11867dc2 (Simon Kelley 2015-12-23
>> 16:15:58 +   3)This program is free software; you can
>> redistribute it and/or modify 11867dc2 (Simon Kelley 2015-12-23
>> 16:15:58 +   4)it under the terms of the GNU General Public
>> License as published by 11867dc2 (Simon Kelley 2015-12-23 16:15:58
>> +   5)the Free Software Foundation; version 2 dated June,
>> 1991, or 11867dc2 (Simon Kelley 2015-12-23 16:15:58 +   6)(at
>> your option) version 3 dated 29 June, 2007. 11867dc2 (Simon Kelley
>> 2015-12-23 16:15:58 +   7) 11867dc2 (Simon Kelley 2015-12-23
>> 16:15:58 +   8)This program is distributed in the hope that
>> it will be useful, 11867dc2 (Simon Kelley 2015-12-23 16:15:58 +
>> 9)but WITHOUT ANY WARRANTY; without even the implied warranty of
>> 11867dc2 (Simon Kelley 2015-12-23 16:15:58 +  10)
>> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
>> 11867dc2 (Simon Kelley 2015-12-23 16:15:58 +  11)GNU General
>> Public License for more details. 11867dc2 (Simon Kelley 2015-12-23
>> 16:15:58 +  12) 11867dc2 (Simon Kelley 2015-12-23 16:15:58 +
>> 13)You should have received a copy of the GNU General Public
>> License 11867dc2 (Simon Kelley 2015-12-23 16:15:58 +  14)
>> along with this program.  If not, see .
>> 11867dc2 (Simon Kelley 2015-12-23 16:15:58 +  15) */
>> stappers@paddy:~/src/dnsmasq $ git blame src/arp.c | head -n 15
>> 2a8710ac (Simon Kelley   2020-01-05 16:40:06 +   1) /* dnsmasq is
>> Copyright (c) 2000-2020 Simon Kelley 11867dc2 (Simon Kelley
>> 2015-12-23 16:15:58 +   2) 11867dc2 (Simon Kelley   2015-12-23
>> 16:15:58 +   3)This program is free software; you can
>> redistribute it and/or modify 11867dc2 (Simon Kelley   2015-12-23
>> 16:15:58 +   4)it under the terms of the GNU General Public
>> License as published by 11867dc2 (Simon Kelley   2015-12-23 16:15:58
>> +   5)the Free Software Foundation; version 2 dated June,
>> 1991, or 11867dc2 (Simon Kelley   2015-12-23 16:15:58 +   6)
>> (at your option) version 3 dated 29 June, 2007. e0984534 (Geert
>> Stappers 2020-03-06 23:12:53 +0100   7) 11867dc2 (Simon Kelley
>> 2015-12-23 16:15:58 +   8)This program is distributed in the
>> hope that it will be useful, 11867dc2 (Simon Kelley   2015-12-23
>> 16:15:58 

Re: [Dnsmasq-discuss] space two point eighty one

2020-03-07 Thread Mark Grant



On Fri, 6 Mar 2020 23:38:46 +0100, Geert Stappers wrote:

> On Fri, Mar 06, 2020 at 02:53:43PM +, Mark Grant wrote:
> > On Thu, 5 Mar 2020 22:34:29 +, Simon Kelley wrote:  
> > > On 05/03/2020 21:05, Geert Stappers wrote:  
> > > > On Thu, Mar 05, 2020 at 09:46:21PM +0100, Geert Stappers
> > > > wrote:
> > > >>>   ...  
> > > >>
> > > >> I plea for removal of unneeded ' ' and '   '.
> > > >>
> > > >> That removal can be done with:
> > > >>
> > > >> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc
> > > >> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc
> > > >> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc
> > > >> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc
> > > >> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc
> > > >> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc
> > > >> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc
> > > > 
> > > > Numbers from output of `wc` increased.
> > > > 
> > > > 
> > > >> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc
> > > >> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc
> > > > 
> > > > Output of `wc` is stable.
> > > > 
> > > > At this point you probably want to do `git diff`
> > > > and will see that trailing-space-only-lines are removed.
> > > > 
> > > > 
> > > >> sed --in-place -e 's/^[ \t]*$//' src/*.c ; git diff | wc
> > > > 
> > > > Lines that had only spaces or tabs got that white space removed.
> > > > 
> > > >  
> > > >> sed --in-place -e 's/^[ \t]*$//' src/*.c ; git diff | wc
> > > >> sed --in-place -e 's/^[ \t]*$//' src/*.c ; git diff | wc
> > > > 
> > > > Output of `wc` is stable.
> > > > 
> > > > `git diff` is huge, almost 22000 lines.  Yes, a huge clean-up.  
> 
> | $ git diff | wc
> | 21782   77039  600247
> 
> That 21782  became the "almost 22000 lines"
> 
> > > > 
> > > > I love to see that in the 2.81 release of dnsmasq.
> > > > 
> > > >  git commit -am "Removed useless whitespace" --author "Geert
> > > > Stappers "
> > > > 
> > > > 
> > > 
> > > The obvious problem with doing that is that for ever more, when I
> > > run "git blame" 22000 lines will have the source "Removed useless
> > > whitespace".  
> 
> Euh `git diff` has "context".
> Better numbers in another email.
> 
> > > I have a feeling someone once posted a solution to that, but I
> > > don't have time to trawl back and find it. Can anyone help?
> > >   
> > Does
> >   git blame -w
> > do the trick?
> > 
> > Mark  
> 
> stappers@paddy:~/src/dnsmasq
> $ git blame -w src/arp.c | head -n 15
> 2a8710ac (Simon Kelley 2020-01-05 16:40:06 +   1) /* dnsmasq is
> Copyright (c) 2000-2020 Simon Kelley 11867dc2 (Simon Kelley
> 2015-12-23 16:15:58 +   2) 11867dc2 (Simon Kelley 2015-12-23
> 16:15:58 +   3)This program is free software; you can
> redistribute it and/or modify 11867dc2 (Simon Kelley 2015-12-23
> 16:15:58 +   4)it under the terms of the GNU General Public
> License as published by 11867dc2 (Simon Kelley 2015-12-23 16:15:58
> +   5)the Free Software Foundation; version 2 dated June,
> 1991, or 11867dc2 (Simon Kelley 2015-12-23 16:15:58 +   6)(at
> your option) version 3 dated 29 June, 2007. 11867dc2 (Simon Kelley
> 2015-12-23 16:15:58 +   7) 11867dc2 (Simon Kelley 2015-12-23
> 16:15:58 +   8)This program is distributed in the hope that
> it will be useful, 11867dc2 (Simon Kelley 2015-12-23 16:15:58 +
> 9)but WITHOUT ANY WARRANTY; without even the implied warranty of
> 11867dc2 (Simon Kelley 2015-12-23 16:15:58 +  10)
> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> 11867dc2 (Simon Kelley 2015-12-23 16:15:58 +  11)GNU General
> Public License for more details. 11867dc2 (Simon Kelley 2015-12-23
> 16:15:58 +  12) 11867dc2 (Simon Kelley 2015-12-23 16:15:58 +
> 13)You should have received a copy of the GNU General Public
> License 11867dc2 (Simon Kelley 2015-12-23 16:15:58 +  14)
> along with this program.  If not, see .
> 11867dc2 (Simon Kelley 2015-12-23 16:15:58 +  15) */
> stappers@paddy:~/src/dnsmasq $ git blame src/arp.c | head -n 15
> 2a8710ac (Simon Kelley   2020-01-05 16:40:06 +   1) /* dnsmasq is
> Copyright (c) 2000-2020 Simon Kelley 11867dc2 (Simon Kelley
> 2015-12-23 16:15:58 +   2) 11867dc2 (Simon Kelley   2015-12-23
> 16:15:58 +   3)This program is free software; you can
> redistribute it and/or modify 11867dc2 (Simon Kelley   2015-12-23
> 16:15:58 +   4)it under the terms of the GNU General Public
> License as published by 11867dc2 (Simon Kelley   2015-12-23 16:15:58
> +   5)the Free Software Foundation; version 2 dated June,
> 1991, or 11867dc2 (Simon Kelley   2015-12-23 16:15:58 +   6)
> (at your option) version 3 dated 29 June, 2007. e0984534 (Geert
> Stappers 2020-03-06 23:12:53 +0100   7) 11867dc2 (Simon Kelley
> 2015-12-23 16:15:58 +   8)This program is distributed 

Re: [Dnsmasq-discuss] space two point eighty one

2020-03-06 Thread Geert Stappers
On Fri, Mar 06, 2020 at 02:53:43PM +, Mark Grant wrote:
> On Thu, 5 Mar 2020 22:34:29 +, Simon Kelley wrote:
> > On 05/03/2020 21:05, Geert Stappers wrote:
> > > On Thu, Mar 05, 2020 at 09:46:21PM +0100, Geert Stappers wrote:  
> > >>>   ...
> > >>
> > >> I plea for removal of unneeded ' ' and ' '.
> > >>
> > >> That removal can be done with:
> > >>
> > >> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc
> > >> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc
> > >> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc
> > >> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc
> > >> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc
> > >> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc
> > >> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc  
> > > 
> > > Numbers from output of `wc` increased.
> > > 
> > >   
> > >> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc
> > >> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc  
> > > 
> > > Output of `wc` is stable.
> > > 
> > > At this point you probably want to do `git diff`
> > > and will see that trailing-space-only-lines are removed.
> > > 
> > >   
> > >> sed --in-place -e 's/^[ \t]*$//' src/*.c ; git diff | wc  
> > > 
> > > Lines that had only spaces or tabs got that white space removed.
> > > 
> > >
> > >> sed --in-place -e 's/^[ \t]*$//' src/*.c ; git diff | wc
> > >> sed --in-place -e 's/^[ \t]*$//' src/*.c ; git diff | wc  
> > > 
> > > Output of `wc` is stable.
> > > 
> > > `git diff` is huge, almost 22000 lines.  Yes, a huge clean-up.

| $ git diff | wc
| 21782   77039  600247

That 21782  became the "almost 22000 lines"

> > > 
> > > I love to see that in the 2.81 release of dnsmasq.
> > > 
> > >  git commit -am "Removed useless whitespace" --author "Geert Stappers 
> > > "
> > > 
> > >   
> > 
> > The obvious problem with doing that is that for ever more, when I run
> > "git blame" 22000 lines will have the source "Removed useless whitespace".

Euh `git diff` has "context".
Better numbers in another email.

> > I have a feeling someone once posted a solution to that, but I don't
> > have time to trawl back and find it. Can anyone help?
> > 
> Does
>   git blame -w
> do the trick?
> 
> Mark

stappers@paddy:~/src/dnsmasq
$ git blame -w src/arp.c | head -n 15
2a8710ac (Simon Kelley 2020-01-05 16:40:06 +   1) /* dnsmasq is Copyright 
(c) 2000-2020 Simon Kelley
11867dc2 (Simon Kelley 2015-12-23 16:15:58 +   2) 
11867dc2 (Simon Kelley 2015-12-23 16:15:58 +   3)This program is free 
software; you can redistribute it and/or modify
11867dc2 (Simon Kelley 2015-12-23 16:15:58 +   4)it under the terms of 
the GNU General Public License as published by
11867dc2 (Simon Kelley 2015-12-23 16:15:58 +   5)the Free Software 
Foundation; version 2 dated June, 1991, or
11867dc2 (Simon Kelley 2015-12-23 16:15:58 +   6)(at your option) 
version 3 dated 29 June, 2007.
11867dc2 (Simon Kelley 2015-12-23 16:15:58 +   7) 
11867dc2 (Simon Kelley 2015-12-23 16:15:58 +   8)This program is 
distributed in the hope that it will be useful,
11867dc2 (Simon Kelley 2015-12-23 16:15:58 +   9)but WITHOUT ANY 
WARRANTY; without even the implied warranty of
11867dc2 (Simon Kelley 2015-12-23 16:15:58 +  10)MERCHANTABILITY or 
FITNESS FOR A PARTICULAR PURPOSE.  See the
11867dc2 (Simon Kelley 2015-12-23 16:15:58 +  11)GNU General Public 
License for more details.
11867dc2 (Simon Kelley 2015-12-23 16:15:58 +  12) 
11867dc2 (Simon Kelley 2015-12-23 16:15:58 +  13)You should have 
received a copy of the GNU General Public License
11867dc2 (Simon Kelley 2015-12-23 16:15:58 +  14)along with this 
program.  If not, see .
11867dc2 (Simon Kelley 2015-12-23 16:15:58 +  15) */
stappers@paddy:~/src/dnsmasq
$ git blame src/arp.c | head -n 15
2a8710ac (Simon Kelley   2020-01-05 16:40:06 +   1) /* dnsmasq is Copyright 
(c) 2000-2020 Simon Kelley
11867dc2 (Simon Kelley   2015-12-23 16:15:58 +   2) 
11867dc2 (Simon Kelley   2015-12-23 16:15:58 +   3)This program is free 
software; you can redistribute it and/or modify
11867dc2 (Simon Kelley   2015-12-23 16:15:58 +   4)it under the terms 
of the GNU General Public License as published by
11867dc2 (Simon Kelley   2015-12-23 16:15:58 +   5)the Free Software 
Foundation; version 2 dated June, 1991, or
11867dc2 (Simon Kelley   2015-12-23 16:15:58 +   6)(at your option) 
version 3 dated 29 June, 2007.
e0984534 (Geert Stappers 2020-03-06 23:12:53 +0100   7) 
11867dc2 (Simon Kelley   2015-12-23 16:15:58 +   8)This program is 
distributed in the hope that it will be useful,
11867dc2 (Simon Kelley   2015-12-23 16:15:58 +   9)but WITHOUT ANY 
WARRANTY; without even the implied warranty of
11867dc2 (Simon Kelley   2015-12-23 16:15:58 +  10)MERCHANTABILITY or 
FITNESS FOR A PARTICULAR PURPOSE.  See the
11867dc2 

Re: [Dnsmasq-discuss] space two point eighty one

2020-03-06 Thread Mark Grant


On Thu, 5 Mar 2020 22:34:29 +, Simon Kelley wrote:

> On 05/03/2020 21:05, Geert Stappers wrote:
> > On Thu, Mar 05, 2020 at 09:46:21PM +0100, Geert Stappers wrote:  
> >> Previous-Subject: Re: [Dnsmasq-discuss] Announce: dnsmasq-2.81rc1
> >> In-Reply-To:
> >> <46b01ef6-df07-44ed-86ba-ccbd2efdb...@darbyshire-bryant.me.uk> On
> >> Tue, Mar 03, 2020 at 09:07:15AM +, Kevin 'ldir'
> >> Darbyshire-Bryant wrote:  
> >>> On 3 Mar 2020, at 06:31, Geert Stappers 
> >>> wrote:  
>  On Mon, Mar 02, 2020 at 10:39:26PM +, Simon Kelley wrote:  
> >
> > ... and let me know ... if there are any loose ends I missed.
> >  
> 
>  In
>  http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/2020q1/013757.html
>  is int count, new;
>  -  struct dhcp_config *config, *candidate;
>  +  struct dhcp_config *config, *candidate;
>    struct hwaddr_config *conf_addr;  
> >>>
> >>> Not sure I understand the relevance Geert but as is common with
> >>> these sort of non obvious replacements, there’s a ‘rogue’ white
> >>> space at the end of the replaced line which is removed by its
> >>> replacement.  
> >>  
> >> Yes, that is the problem:  rogue white space is considered
> >> irrelevant
> >>
> >> I plea for removal of unneeded ' ' and '   '.
> >>
> >> That removal can be done with:
> >>
> >> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc
> >> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc
> >> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc
> >> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc
> >> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc
> >> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc
> >> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc  
> > 
> > Numbers from output of `wc` increased.
> > 
> >   
> >> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc
> >> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc  
> > 
> > Output of `wc` is stable.
> > 
> > At this point you probably want to do `git diff`
> > and will see that trailing-space-only-lines are removed.
> > 
> >   
> >> sed --in-place -e 's/^[ \t]*$//' src/*.c ; git diff | wc  
> > 
> > Lines that had only spaces or tabs got that white space removed.
> > 
> >
> >> sed --in-place -e 's/^[ \t]*$//' src/*.c ; git diff | wc
> >> sed --in-place -e 's/^[ \t]*$//' src/*.c ; git diff | wc  
> > 
> > Output of `wc` is stable.
> > 
> > `git diff` is huge, almost 22000 lines.  Yes, a huge clean-up.
> > 
> > 
> > I love to see that in the 2.81 release of dnsmasq.
> > 
> >  git commit -am "Removed useless whitespace" --author "Geert
> > Stappers "
> > 
> >   
> 
> The obvious problem with doing that is that for ever more, when I run
> "git blame" 22000 lines will have the source "Removed useless
> whitespace".
> 
> I have a feeling someone once posted a solution to that, but I don't
> have time to trawl back and find it. Can anyone help?
> 
Does
git blame -w

do the trick?
Mark
> 
> Simon.
> 
> 


pgpYI64PxC56f.pgp
Description: OpenPGP digital signature
___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] space two point eighty one

2020-03-05 Thread Simon Kelley
On 05/03/2020 21:05, Geert Stappers wrote:
> On Thu, Mar 05, 2020 at 09:46:21PM +0100, Geert Stappers wrote:
>> Previous-Subject: Re: [Dnsmasq-discuss] Announce: dnsmasq-2.81rc1
>> In-Reply-To: <46b01ef6-df07-44ed-86ba-ccbd2efdb...@darbyshire-bryant.me.uk>
>> On Tue, Mar 03, 2020 at 09:07:15AM +, Kevin 'ldir' Darbyshire-Bryant 
>> wrote:
>>> On 3 Mar 2020, at 06:31, Geert Stappers  wrote:
 On Mon, Mar 02, 2020 at 10:39:26PM +, Simon Kelley wrote:
>
> ... and let me know ... if there are any loose ends I missed.
>

 In 
 http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/2020q1/013757.html
 is
   int count, new;
 -  struct dhcp_config *config, *candidate;
 +  struct dhcp_config *config, *candidate;
   struct hwaddr_config *conf_addr;
>>>
>>> Not sure I understand the relevance Geert but as is common with these
>>> sort of non obvious replacements, there’s a ‘rogue’ white space
>>> at the end of the replaced line which is removed by its replacement.
>>  
>> Yes, that is the problem:  rogue white space is considered irrelevant
>>
>> I plea for removal of unneeded ' ' and ' '.
>>
>> That removal can be done with:
>>
>> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc
>> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc
>> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc
>> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc
>> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc
>> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc
>> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc
> 
> Numbers from output of `wc` increased.
> 
> 
>> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc
>> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc
> 
> Output of `wc` is stable.
> 
> At this point you probably want to do `git diff`
> and will see that trailing-space-only-lines are removed.
> 
> 
>> sed --in-place -e 's/^[ \t]*$//' src/*.c ; git diff | wc
> 
> Lines that had only spaces or tabs got that white space removed.
> 
>  
>> sed --in-place -e 's/^[ \t]*$//' src/*.c ; git diff | wc
>> sed --in-place -e 's/^[ \t]*$//' src/*.c ; git diff | wc
> 
> Output of `wc` is stable.
> 
> `git diff` is huge, almost 22000 lines.  Yes, a huge clean-up.
> 
> 
> I love to see that in the 2.81 release of dnsmasq.
> 
>  git commit -am "Removed useless whitespace" --author "Geert Stappers 
> "
> 
> 

The obvious problem with doing that is that for ever more, when I run
"git blame" 22000 lines will have the source "Removed useless whitespace".

I have a feeling someone once posted a solution to that, but I don't
have time to trawl back and find it. Can anyone help?


Simon.




signature.asc
Description: OpenPGP digital signature
___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] space two point eighty one

2020-03-05 Thread Geert Stappers
On Thu, Mar 05, 2020 at 09:46:21PM +0100, Geert Stappers wrote:
> Previous-Subject: Re: [Dnsmasq-discuss] Announce: dnsmasq-2.81rc1
> In-Reply-To: <46b01ef6-df07-44ed-86ba-ccbd2efdb...@darbyshire-bryant.me.uk>
> On Tue, Mar 03, 2020 at 09:07:15AM +, Kevin 'ldir' Darbyshire-Bryant 
> wrote:
> > On 3 Mar 2020, at 06:31, Geert Stappers  wrote:
> > > On Mon, Mar 02, 2020 at 10:39:26PM +, Simon Kelley wrote:
> > >> 
> > >> ... and let me know ... if there are any loose ends I missed.
> > >> 
> > > 
> > > In 
> > > http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/2020q1/013757.html
> > > is
> > >   int count, new;
> > > -  struct dhcp_config *config, *candidate;
> > > +  struct dhcp_config *config, *candidate;
> > >   struct hwaddr_config *conf_addr;
> > 
> > Not sure I understand the relevance Geert but as is common with these
> > sort of non obvious replacements, there’s a ‘rogue’ white space
> > at the end of the replaced line which is removed by its replacement.
>  
> Yes, that is the problem:  rogue white space is considered irrelevant
> 
> I plea for removal of unneeded ' ' and '  '.
> 
> That removal can be done with:
> 
> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc
> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc
> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc
> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc
> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc
> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc
> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc

Numbers from output of `wc` increased.


> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc
> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc

Output of `wc` is stable.

At this point you probably want to do `git diff`
and will see that trailing-space-only-lines are removed.


> sed --in-place -e 's/^[ \t]*$//' src/*.c ; git diff | wc

Lines that had only spaces or tabs got that white space removed.

 
> sed --in-place -e 's/^[ \t]*$//' src/*.c ; git diff | wc
> sed --in-place -e 's/^[ \t]*$//' src/*.c ; git diff | wc

Output of `wc` is stable.

`git diff` is huge, almost 22000 lines.  Yes, a huge clean-up.


I love to see that in the 2.81 release of dnsmasq.

 git commit -am "Removed useless whitespace" --author "Geert Stappers 
"



Regards
Geert Stappers
-- 
Silence is hard to parse


signature.asc
Description: PGP signature
___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss