public inbox for git@vger.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Jean-Noël Avila" <jn.avila@free.fr>
Cc: "D. Ben Knoble" <ben.knoble+github@gmail.com>,
	 git@vger.kernel.org, Christian Couder <chriscool@tuxfamily.org>,
	 Kristoffer Haugsbakk <code@khaugsbakk.name>,
	 Elijah Newren <newren@gmail.com>,
	 "brian m. carlson" <sandals@crustytoothpaste.net>,
	 Sergey Organov <sorganov@gmail.com>
Subject: Re: [PATCH] replay: drop rev-list formatting options from manual
Date: Wed, 21 Jan 2026 08:26:24 -0800	[thread overview]
Message-ID: <xmqq8qdrvsnj.fsf@gitster.g> (raw)
In-Reply-To: <adfdcc47-470a-4424-9268-31699decee16@free.fr> ("Jean-Noël Avila"'s message of "Wed, 21 Jan 2026 14:27:05 +0100")

Jean-Noël Avila <jn.avila@free.fr> writes:

>> The original comes from f81a574f (doc: test linkgit macros for
>> well-formedness, 2025-08-11); its author Cc'ed for better ideas.
>> 
>
> The initial motive for this script was to catch malformed linkgit
> occurrences that were present in the docs: stray git-foo[1], without
> the linkgit macro and misnamed gitlink:git-foo[1]. Not knowing what
> would come next, the regex was coined very broad, with the assumed risk
> of raising false positives.
>
> The issue here is in handling the ifdef macros which are block macros
> and are more easily detected as such. I would reject preemtively lines
> with '^ifn?def::' instead.

Yup, that is much cleaner.  Thanks!

> ----- >8 -----
> Subject: [PATCH] lint-gitlink: preemptively ignore all /ifn?def|endif/ macros
>
> Instead of testing if the macro name is ifn?def:: as if it were a inline
> macro, it is faster and safer to just ignore such block macro lines before
> hand.
>
> Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
> ---
>  Documentation/lint-gitlink.perl | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/lint-gitlink.perl b/Documentation/lint-gitlink.perl
> index f183a18df..b5d982e8e 100755
> --- a/Documentation/lint-gitlink.perl
> +++ b/Documentation/lint-gitlink.perl
> @@ -41,10 +41,11 @@ sub report {
>  @ARGV = $to_check;
>  while (<>) {
>  	my $line = $_;
> +	next if $line =~ /^\s*(ifn?def|endif)::/;
>  	while ($line =~ m/(.{,8})((git[-a-z]+|scalar)\[(\d)*\])/g) {
>  	    my $pos = pos $line;
>  	    my ($macro, $target, $page, $section) = ($1, $2, $3, $4);
> -		if ( $macro ne "linkgit:" && $macro !~ "ifn?def::" && $macro ne "endif::" ) {
> +		if ( $macro ne "linkgit:" ) {
>  			report($pos, $line, $target, "linkgit: macro expected");
>  		}
>  	}

  reply	other threads:[~2026-01-21 16:26 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-20  1:47 [PATCH] replay: drop rev-list formatting options from manual D. Ben Knoble
2026-01-20  2:19 ` Junio C Hamano
2026-01-20 14:04   ` D. Ben Knoble
2026-01-20 15:37     ` Junio C Hamano
2026-01-20 21:49       ` Junio C Hamano
2026-01-20 23:11         ` Junio C Hamano
2026-01-21 13:27           ` Jean-Noël Avila
2026-01-21 16:26             ` Junio C Hamano [this message]
2026-01-21 20:03               ` D. Ben Knoble
2026-01-27 18:48                 ` D. Ben Knoble
2026-01-20 14:05 ` [PATCH v2] " D. Ben Knoble

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=xmqq8qdrvsnj.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=ben.knoble+github@gmail.com \
    --cc=chriscool@tuxfamily.org \
    --cc=code@khaugsbakk.name \
    --cc=git@vger.kernel.org \
    --cc=jn.avila@free.fr \
    --cc=newren@gmail.com \
    --cc=sandals@crustytoothpaste.net \
    --cc=sorganov@gmail.com \
    /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