Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 4 Sep 2020 21:01:25 +0200
From:      Mateusz Guzik <mjguzik@gmail.com>
To:        Andrew Gallatin <gallatin@cs.duke.edu>
Cc:        Alexey Dokuchaev <danfe@freebsd.org>, Michael Tuexen <tuexen@fh-muenster.de>,  Pedro Giffuni <pfg@freebsd.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r365071 - in head/sys: net net/altq net/route net80211 netgraph netgraph/atm netgraph/atm/ccatm netgraph/atm/sscfu netgraph/atm/sscop netgraph/atm/uni netgraph/bluetooth/common netgraph...
Message-ID:  <CAGudoHHiUc3GXbRUVt9rc%2Bra1E3sA7Fvv9XxwE1cCbkRMXE07g@mail.gmail.com>
In-Reply-To: <60ea593f-8258-e30d-b897-f162168b44d3@cs.duke.edu>
References:  <202009012119.081LJERb018106@repo.freebsd.org> <95844C00-D10A-456D-AD29-DF572043074F@fh-muenster.de> <20200902020507.GA38274@FreeBSD.org> <eba32e79-4b90-ecce-7bbb-455f691d4444@FreeBSD.org> <20200902180626.GA88595@FreeBSD.org> <6124a908-25a5-e023-16da-7963ba229b7f@FreeBSD.org> <08636D5E-AA07-4AE7-B5AC-656B08CF564B@fh-muenster.de> <20200903024226.GA54078@FreeBSD.org> <60ea593f-8258-e30d-b897-f162168b44d3@cs.duke.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
On 9/4/20, Andrew Gallatin <gallatin@cs.duke.edu> wrote:
> On 2020-09-02 22:42, Alexey Dokuchaev wrote:
>
>>> I want to understand which rules have to be followed (and why).
>>
>> In general, FreeBSD code we write should follow style(9); it specifically
>> mentions "do not add whitespace at the end of a line" and "... followed
>> by
>> one blank line" but doesn't go as far as explicitly forbidding multiple
>> consecutive newlines.  To me it's pretty obvious, and while others might
>> have different sens esthe'tique, usually it is lack thereof (no offense)
>> or mere ignorance.
>>
>> ./danfe
>>
>> P.S.  Old-school tools like indent(1) or `uncrustify' were never widely
>> popular, I guess, because they did not possess enough knowledge of the
>> language to always produce correct results.  Perhaps new era tools, like
>> clang-format, could bring this to a whole new level.
>>
>
> I do the upstream sync between the Netflix tree and
> FreeBSD-current about every 3 weeks (unless glebius beats
> me to the punch and does it first :).  I anticipate that
> this blank line sweep will cause lots of conflicts for us.
> I understand this is progress, and I don't object, and I'm
> not asking for a revert, but please understand that cleanups
> like this do have hidden costs.  I expect that other commercial
> entities who contribute to FreeBSD will have the same issue,
> and I also anticipate it will cause problems with MFCs
>
> Rather than doing more sweeps like this, is it possible to
> come up with a clang-format rule that's 95% of style(9), do
> just one more sweep of the tree to apply that rule, add that
> rule as a pre-commit hook, and be done forever with style(9)
> related changes?
>

For starters I completely agree with the need for tooling to prevent
addition of more non-conformant code, but I'm leaving this for someone
else. I don't intend to do any more sweeps (modulo perhaps vfs code).

I would like to note that directories like contrib, zfs, netmap and
others which have known upstream got intentionally skipped during to
not mess with imports. Of course this does not necessary cover all
merges.

Merges regardless of the above (or going the other way) should not be
very problematic though. No design changes are needed, let alone any
testing on account of the above. Worst case this is just minor
annoyance which can be cleaned up while watching The Sopranos with one
eye.

Note that ultimately there is a hidden cost to previous state as well.
What perhaps is not clear from the commit message and wont be seen
unless you scrutinize the diffs, some lines got changed from having
tabs and/or spaces instead of just a newline. This kind of stuff is
jumps at you every time if you have an editor configured to report it
(you can find a vim snipped at the bottom of interested).

That being said, I understand this generated work for some people but
I don't think it consitutes a problem. Also I don't think a heads up
would change anything here. If I was planning more invasive work I
would definitely try to coordinate. Also note the changeset does not
interfere with git blame (unless you want to look at empty lines).

Here is vim snipped I stole from someone several years back:
highlight ExtraWhitespace ctermbg=red guibg=red
autocmd BufWinEnter *.{c,pl,pm} match ExtraWhitespace /^\s*     \|\s\+$/
autocmd InsertEnter *.{c,pl,pm} match ExtraWhitespace /^\s*     \|\s\+\%#\@<!$/
autocmd InsertLeave *.{c,pl,pm} match ExtraWhitespace /^\s*     \|\s\+$/
autocmd BufWinLeave *.{c,pl,pm} call clearmatches()

-- 
Mateusz Guzik <mjguzik gmail.com>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAGudoHHiUc3GXbRUVt9rc%2Bra1E3sA7Fvv9XxwE1cCbkRMXE07g>