Drop the date from the committed man page (#3659)

The date in the .TH line of jq.1.prebuilt changed whenever the manual was
regenerated in a new month, causing merge conflicts between pull requests
that touch the manual, and it did not reflect the release date anyway.
Generate the committed man page without a date.

Stamp the date into jq.1 at build time instead, taking it from the current
commit, or from SOURCE_DATE_EPOCH where that is set, so that release
tarballs and distribution builds still carry one and the behaviour added
in #3514 is kept. Write it in UTC and in ISO 8601 rather than the previous
"%B %Y", for which mandoc reports "cannot parse date, using it verbatim".
This commit is contained in:
itchyny authored and GitHub committed 2026-10-08 22:16:42 +09:00
1 parent fd25c3e720
commit 17b87d25c7
4 files changed
+15 -14

No files matched your search

+1 -6
View File
@@ -1,13 +1,10 @@
#!/usr/bin/env python3
from datetime import date
from io import StringIO
from lxml import etree
import markdown
from markdown.extensions import Extension
import re
import os
import sys
from time import time
import yaml
@@ -68,9 +65,7 @@ class RoffWalker(object):
last_tag = None
while root is not None:
if root.tag == 'h1':
epoch = int(os.environ.get('SOURCE_DATE_EPOCH', time()))
self.__write_cmd('.TH "JQ" "1" "{}" "" ""'.format(
date.fromtimestamp(epoch).strftime('%B %Y')))
self.__write_cmd('.TH "JQ" "1" "" "" ""')
self.__write_cmd('.SH "NAME"')
# TODO: properly parse this
self.__write_raw(r'\fBjq\fR \- Command\-line JSON processor' +