[Dnsmasq-discuss] space two point eighty one

Mark Grant m.grant.prg at gmail.com
Fri Mar 6 14:53:43 GMT 2020



On Thu, 5 Mar 2020 22:34:29 +0000, 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-CCBD2EFDB368 at darbyshire-bryant.me.uk> On
> >> Tue, Mar 03, 2020 at 09:07:15AM +0000, Kevin 'ldir'
> >> Darbyshire-Bryant wrote:  
> >>> On 3 Mar 2020, at 06:31, Geert Stappers <stappers at stappers.nl>
> >>> wrote:  
> >>>> On Mon, Mar 02, 2020 at 10:39:26PM +0000, 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 <stappers at stappers.nl>"
> > 
> >   
> 
> 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.
> 
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/attachments/20200306/cfb66750/attachment.sig>


More information about the Dnsmasq-discuss mailing list