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