From: Junio C Hamano <gitster@pobox.com>
To: "Julia Evans via GitGitGadget" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, Julia Evans <julia@jvns.ca>
Subject: Re: [PATCH] doc: don't require a SYNOPSIS in section 7
Date: Fri, 02 Oct 2026 10:33:24 -0700 [thread overview]
Message-ID: <xmqqv77kvwgr.fsf@gitster.g> (raw)
In-Reply-To: <pull.2246.git.1790957227881.gitgitgadget@gmail.com> (Julia Evans via GitGitGadget's message of "Fri, 02 Oct 2026 16:07:07 +0000")
"Julia Evans via GitGitGadget" <gitgitgadget@gmail.com> writes:
> From: Julia Evans <julia@jvns.ca>
>
> Remove the SYNOPSIS section from the section 7 man pages where
> appropriate, to avoid having a section that contains no information.
> It's not the norm in section 7 to always require a SYNOPSIS.
Very true.
> diff --git a/Documentation/gitcli.adoc b/Documentation/gitcli.adoc
> index 6815d6bfb7..9c4598e29c 100644
> --- a/Documentation/gitcli.adoc
> +++ b/Documentation/gitcli.adoc
> @@ -5,11 +5,6 @@ NAME
> ----
> gitcli - Git command-line interface and conventions
>
> -SYNOPSIS
> ---------
> -gitcli
> -
> -
> DESCRIPTION
> -----------
>
Yup. Thanks for starting this move. These "we add meaningless
filler only because we need to" were always eyesore.
> diff --git a/Documentation/lint-man-section-order.perl b/Documentation/lint-man-section-order.perl
> index 02408a0062..e032f6ae53 100755
> --- a/Documentation/lint-man-section-order.perl
> +++ b/Documentation/lint-man-section-order.perl
> @@ -53,6 +53,11 @@ sub report {
> $exit_code = 1;
> }
>
> +# assume the first line is formatted like 'gitglossary(7)'
> +my $firstline = <>;
> +$firstline =~ m/\((\d)\)/;
> +my $man_section_number = $1;
This means that the main loop that has already read all the lines of
the file no longer sees the first line. I do not think it would
immediately break anything (in other words, the current
implementation of the loop only checks the section header and
nothing else), but it may be an unhealthy thing to assume that this
will not change.
It would be very simple to move it inside the loop.
Would it work better to do it this way, I wonder? The idea is to
notice what manual sections we are in, and tweak the %SECTIONS
contents there, to allow us customize behaviour for other sections
later, and keep such customizations out of the actual code.
Documentation/lint-man-section-order.perl | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git c/Documentation/lint-man-section-order.perl w/Documentation/lint-man-section-order.perl
index 02408a0062..ce60c34809 100755
--- c/Documentation/lint-man-section-order.perl
+++ w/Documentation/lint-man-section-order.perl
@@ -55,8 +55,23 @@ sub report {
my $last_was_section;
my @actual_order;
+my $section_tweak_done;
while (my $line = <>) {
chomp $line;
+
+ if (!$section_tweak_done) {
+ # assume the first line is formatted like 'gitglossary(7)'
+ my $firstline = <>;
+ $firstline =~ m/\((\d)\)/;
+ my $man_section_number = $1;
+
+ if ($man_section_number == "7") {
+ # section 7 usually do not have SYNOPSIS
+ $SECTIONS{SYNOPSIS}{required} = 0;
+ }
+ $section_tweak_done = 1;
+ }
+
if ($line =~ $SECTION_RX) {
push @actual_order => $line;
$last_was_section = 1;
next prev parent reply other threads:[~2026-10-02 17:33 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-02 16:07 [PATCH] doc: don't require a SYNOPSIS in section 7 Julia Evans via GitGitGadget
2026-10-02 17:33 ` Junio C Hamano [this message]
2026-10-02 18:03 ` Junio C Hamano
2026-10-02 18:10 ` Julia Evans
2026-10-02 18:20 ` Julia Evans
2026-10-02 21:34 ` Junio C Hamano
2026-10-03 7:33 ` Tuomas Ahola
2026-10-03 11:37 ` Julia Evans
2026-10-03 12:55 ` Tuomas Ahola
2026-10-03 13:10 ` [PATCH v2] " Julia Evans via GitGitGadget
2026-10-04 13:17 ` Junio C Hamano
2026-10-06 11:17 ` Julia Evans
2026-10-06 16:07 ` Junio C Hamano
2026-10-06 16:54 ` [PATCH v3] " Julia Evans via GitGitGadget
2026-10-06 20:40 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqv77kvwgr.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=julia@jvns.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox