git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] replay: drop rev-list formatting options from manual

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 21, 2026, 16:26 UTC
Message-ID
<xmqq8qdrvsnj.fsf@gitster.g>
In-Reply-To
<adfdcc47-470a-4424-9268-31699decee16@free.fr>
Jean-Noël Avila <jn.avila@free.fr> writes:
Show 13 quoted lines
>> 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!
Show 29 quoted lines
> ----- >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");
>  		}
>  	}
Previous: Jean-Noël AvilaNext: D. Ben Knoble
Message 8 of 11 in “replay: drop rev-list formatting options from manual”
  1. replay: drop rev-list formatting options from manualD. Ben Knoble, Jan 20, 2026
  2. Junio C HamanoJan 20, 2026
  3. D. Ben KnobleJan 20, 2026
  4. Junio C HamanoJan 20, 2026
  5. Junio C HamanoJan 20, 2026
  6. Junio C HamanoJan 20, 2026
  7. Jean-Noël AvilaJan 21, 2026
  8. Junio C HamanoJan 21, 2026
  9. D. Ben KnobleJan 21, 2026
  10. D. Ben KnobleJan 27, 2026
  11. replay: drop rev-list formatting options from manualD. Ben Knoble, Jan 20, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.