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

Re: [PATCH] doc: doc-diff: specify date

From
Jeff King <peff@peff.net>
Date
May 5, 2023, 21:16 UTC
Message-ID
<20230505211610.GA3197168@coredump.intra.peff.net>
In-Reply-To
<xmqqzg6jgw47.fsf@gitster.g>
On Thu, May 04, 2023 at 10:55:52PM -0700, Junio C Hamano wrote:
Show 24 quoted lines
> Jeff King <peff@peff.net> writes:
> 
> >> >  			GIT_VERSION=omitted \
> >> > +			GIT_DATE=1970-01-01 \
> >> >  			SOURCE_DATE_EPOCH=0 \
> >> >  			DESTDIR="$tmp/installed/$dname+" \
> >> >  			install-man &&
> >> 
> >> I wonder what the existing SOURCE_DATE_EPOCH was trying to do there,
> >> though.
> >
> > It used to be necessary so that we had a reproducible build. Otherwise,
> > asciidoc uses the mtime of the file, and diffing two versions would have
> > tons of uninteresting date-differences.
> >
> > After 28fde3a1 I doubt it is necessary, as the header uses $GIT_DATE
> > instead (it's possible the mtime may be used elsewhere, but I didn't see
> > any spot after grepping a built xml file. And at any rate, if it does
> > not produce a visible difference, that is enough for doc-diff).
> 
> Thanks for confirming my suspicion.  I guess leaving it there still
> would not hurt.  It can be removed whenever somebody motivated
> enough comes and shows a well-reasoned patch that explains why it no
> longer is necessary ;-)
-- >8 --
Subject: [PATCH] doc-diff: drop SOURCE_DATE_EPOCH override

The original doc-diff script set SOURCE_DATE_EPOCH to make asciidoc's output deterministic. Otherwise, the mtime of the source files would end up in the footer of the manpage, causing noisy and uninteresting diff hunks.

But this has been unused since 28fde3a1f4 (doc: set actual revdate for manpages, 2023-04-13), as the footer uses the externally-specified GIT_DATE instead (that needs to be set consistently, too, which it now is as of the previous commit).

Asciidoc sets several automatic attributes based on the mtime (or manual epoch), so it's still possible to write a document that would need SOURCE_DATE_EPOCH set to be deterministic. But if we wrote such a thing, it's probably a mistake, and we're better off having doc-diff loudly show it.

Signed-off-by: Jeff King <peff@peff.net>
---
 Documentation/doc-diff | 1 -
 1 file changed, 1 deletion(-)
diff --git a/Documentation/doc-diff b/Documentation/doc-diff
index 554a78a12d..fb09e0ac0e 100755
--- a/Documentation/doc-diff
+++ b/Documentation/doc-diff
@@ -154,7 +154,6 @@ render_tree () {
 			$makemanflags \
 			GIT_VERSION=omitted \
 			GIT_DATE=1970-01-01 \
-			SOURCE_DATE_EPOCH=0 \
 			DESTDIR="$tmp/installed/$dname+" \
 			install-man &&
 		mv "$tmp/installed/$dname+" "$tmp/installed/$dname"
-- 
2.40.1.802.gdef2a8734a
Previous: Junio C HamanoNext: Felipe Contreras
Message 5 of 6 in “doc: doc-diff: specify date”
  1. doc: doc-diff: specify dateFelipe Contreras, May 3, 2023
  2. Junio C HamanoMay 5, 2023
  3. Jeff KingMay 5, 2023
  4. Junio C HamanoMay 5, 2023
  5. Jeff KingMay 5, 2023
  6. Felipe ContrerasMay 8, 2023

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.