Discussion
Loading...

Post

Log in
  • About
  • Code of conduct
  • Privacy
  • Users
  • Instances
  • About Bonfire
Graham Perrin
Graham Perrin
@grahamperrin@mastodon.bsd.cafe  ·  activity timestamp 2 weeks ago

@emaste thanks for <https://github.com/freebsd/freebsd-src/commit/97beb0c9116f312c1820adb94455dc3b9a157135> – <https://github.com/freebsd/freebsd-src/blob/main/CONTRIBUTING.md> is certainly easier to digest.

A handful of minor questions/issues …

GitHub

freebsd-src/CONTRIBUTING.md at main · freebsd/freebsd-src

The FreeBSD src tree publish-only repository. Experimenting with 'simple' pull requests.... - freebsd/freebsd-src
  • Copy link
  • Flag this post
  • Block
Graham Perrin
Graham Perrin
@grahamperrin@mastodon.bsd.cafe  ·  activity timestamp 2 weeks ago

<https://github.com/freebsd/freebsd-src/blob/main/CONTRIBUTING.md#style> mentions the one-sentence-per-line rule for manual pages, however:

a) there's no such rule in mdoc(7) <https://man.freebsd.org/cgi/man.cgi?query=mdoc&sektion=7&manpath=freebsd-current> or style.mdoc(5) <https://man.freebsd.org/cgi/man.cgi?query=style.mdoc&sektion=5&manpath=freebsd-current>; and

b) I frequently see multiple lines for a single sentence – is this simply because authors and reviewers happily ignore a rule?

A random pick, from a very recently changed page:

<https://github.com/freebsd/freebsd-src/blob/f2c2e5b0bf9def01b10651b9802fa38d07d9d265/share/man/man4/multicast.4#L163-L166>

– the longest line is 78 characters.

FreeBSD style aside, Debian man-pages(7) suggests a source code line length of no more than about 75 characters wherever possible: <https://manpages.debian.org/trixie/manpages/man-pages.7.en.html#Conventions_for_source_file_layout>.

#FreeBSD #documentation #manpages

GitHub

freebsd-src/share/man/man4/multicast.4 at f2c2e5b0bf9def01b10651b9802fa38d07d9d265 · freebsd/freebsd-src

The FreeBSD src tree publish-only repository. Experimenting with 'simple' pull requests.... - freebsd/freebsd-src

style.mdoc(5)

mdoc(7)

GitHub

freebsd-src/CONTRIBUTING.md at main · freebsd/freebsd-src

The FreeBSD src tree publish-only repository. Experimenting with 'simple' pull requests.... - freebsd/freebsd-src
  • Copy link
  • Flag this comment
  • Block
David Chisnall (*Now with 50% more sarcasm!*)
David Chisnall (*Now with 50% more sarcasm!*)
@david_chisnall@infosec.exchange  ·  activity timestamp 2 weeks ago

@grahamperrin

I generally find FreeBSD’s style(9) to be exactly the opposite of the coding conventions you’d adopt to make bugs visible. Most man pages I’ve read have been wrapped on some arbitrary boundary and it makes diffs really hard to review.

For non-code text, I always use a one-sentence-per-line rule. It makes review much easier and means that line-diff tools (which, for better or worse, are the tools we have) work nicely.

  • Copy link
  • Flag this comment
  • Block
zev
zev
@zev@honk.bewilderbeest.net  ·  activity timestamp 2 weeks ago

@david_chisnall @grahamperrin

line-diff tools (which, for better or worse, are the tools we have)

git diff --color-words is a tool that we have, and an extremely useful one for making prose diffs more readable, FWIW. (Even if sentence-per-line formatted, but especially so if not.)

8KWg7nqH4H5y37vf71.png
8KWg7nqH4H5y37vf71.png
8KWg7nqH4H5y37vf71.png
  • Copy link
  • Flag this comment
  • Block
David Chisnall (*Now with 50% more sarcasm!*)
David Chisnall (*Now with 50% more sarcasm!*)
@david_chisnall@infosec.exchange  ·  activity timestamp 2 weeks ago

@zev @grahamperrin

Which is fine when you have it, but web review UIs and patches in emails are less clear (GitHub does highlight changed words).

  • Copy link
  • Flag this comment
  • Block
Graham Perrin
Graham Perrin
@grahamperrin@mastodon.bsd.cafe  ·  activity timestamp last week

@david_chisnall I have only one minor criticism of GitHub's highlighting, and I don't know whether it is (or should be) fixable.

In cases such as the one pictured below, it's necessary to scroll/page down hugely to bring a tiny change into sight.

In other words, 'Show Diff' shows much, much more than the diff.

A wild guess: maybe specific to AsciiDoc in GitHub, or the FreeBSD Documentation Project's use of AsciiDoc in cases such as this.

@zev @bentolor

#GitHub #AsciiDoc #preview #diff

2 media
Screenshot: a large AsciiDoc page in GitHub, previewing a very small change, opting to show the diff.
Screenshot: a large AsciiDoc page in GitHub, previewing a very small change, opting to show the diff.
Screenshot: a large AsciiDoc page in GitHub, previewing a very small change, opting to show the diff.
Screenshot: the tiny, two-sentence change, is way down near the foot of the page. Note the size and position of the inner scroller.
Screenshot: the tiny, two-sentence change, is way down near the foot of the page. Note the size and position of the inner scroller.
Screenshot: the tiny, two-sentence change, is way down near the foot of the page. Note the size and position of the inner scroller.
  • Copy link
  • Flag this comment
  • Block
David Chisnall (*Now with 50% more sarcasm!*)
David Chisnall (*Now with 50% more sarcasm!*)
@david_chisnall@infosec.exchange  ·  activity timestamp 2 weeks ago

@grahamperrin

As a concrete example: many years ago it was a struggle to make a change that allowed putting braces around single-statement bodies of if statements. It was previously disallowed entirely, now it is optional. This is a common source of bugs when people make changes to a file and add another statement to a conditional, or simply misread the behaviour. Even when they do it correctly, it makes the diffs harder to review because the lines above and blow are changed to add braces. This composes particularly badly with the rule that open braces go on the line with the if statement (ignoring the other reasons that is bad) because it means now the s up in the diff and reviewers need to read it to see that the only change is adding a brace at the end. All of this increases cognitive load that could be better spent seeing if the logic is correct.

  • Copy link
  • Flag this comment
  • Block

bonfire.cafe

A space for Bonfire maintainers and contributors to communicate

bonfire.cafe: About · Code of conduct · Privacy · Users · Instances
Bonfire social · 1.0.2-alpha.34 no JS en
Automatic federation enabled
Log in
Instance logo
  • Explore
  • About
  • Members
  • Code of Conduct