Skip to content

Commit beb8081

Browse files
Martin Ågrengitster
authored andcommitted
asciidoctor-extensions.rb.in: inject GIT_DATE
After a38edab (Makefile: generate doc versions via GIT-VERSION-GEN, 2024-12-06), we no longer inject GIT_DATE when building with Asciidoctor. Replace the <date/> tag in the XML to inject the value of GIT_DATE. Unlike <refmiscinfo/> as handled in a recent commit, we have no reason to expect that this tag might be missing, so there's no need for "maybe remove, then add" and we can just outright replace the one that Asciidoctor has generated based on the mtime of the source file. Compared to pre-a38edab7c8, we now end up injecting this also in the build of Git.3pm, which until now has been using the mtime of Git.pm. That is arguably even a good change since it results in more reproducible builds. Signed-off-by: Martin Ågren <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent c683924 commit beb8081

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Documentation/asciidoctor-extensions.rb.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ module Git
3131
if document.basebackend? 'docbook'
3232
output = output.sub(/<refmiscinfo class="source">.*?<\/refmiscinfo>/, "")
3333
output = output.sub(/<refmiscinfo class="manual">.*?<\/refmiscinfo>/, "")
34+
output = output.sub(/<date>.*?<\/date>/, "<date>@GIT_DATE@</date>")
3435
new_tags = "" \
3536
"<refmiscinfo class=\"source\">Git @GIT_VERSION@</refmiscinfo>\n" \
3637
"<refmiscinfo class=\"manual\">Git Manual</refmiscinfo>\n"

0 commit comments

Comments
 (0)