Skip to content

Commit

Permalink
asciidoctor-extensions.rb.in: inject GIT_DATE
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Martin Ågren authored and gitster committed Dec 21, 2024
1 parent c683924 commit beb8081
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Documentation/asciidoctor-extensions.rb.in
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ module Git
if document.basebackend? 'docbook'
output = output.sub(/<refmiscinfo class="source">.*?<\/refmiscinfo>/, "")
output = output.sub(/<refmiscinfo class="manual">.*?<\/refmiscinfo>/, "")
output = output.sub(/<date>.*?<\/date>/, "<date>@GIT_DATE@</date>")
new_tags = "" \
"<refmiscinfo class=\"source\">Git @GIT_VERSION@</refmiscinfo>\n" \
"<refmiscinfo class=\"manual\">Git Manual</refmiscinfo>\n"
Expand Down

0 comments on commit beb8081

Please sign in to comment.