[PATCH] gitlog-to-changelog: Make output reproducible. (original) (raw)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
From: | Simon Josefsson |
---|---|
Subject: | [PATCH] gitlog-to-changelog: Make output reproducible. |
Date: | Fri, 12 Apr 2024 17:33:43 +0200 |
User-agent: | Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) |
Hi
I ran into a reproducability problem in gitlog-to-changelog, and noticed Guix people had also ran into this and worked around it outside of gitlog-to-changelog:
https://issues.guix.gnu.org/70169/#21
However I don't think it makes sense for ChangeLog dates to depend on the timezone under any circumstance.
One nit may be that I'm not certain the 'git log' command is time zone dependent, but at least I could reproduce timezone problems before applying this patch but not after applying it, so I believe the 'git log' command already was not time zone dependent. Test like this:
jas@kaka:/src/gnulib$ build-aux/gitlog-to-changelog > foo
jas@kaka:/src/gnulib$ TZ=UTC0 build-aux/gitlog-to-changelog > bar
jas@kaka:~/src/gnulib$ diff -ur foo bar
I have committed this.
/Simon
From dfb71172a46ef41f8cf8ab7ca529c1dd3097a41d Mon Sep 17 00:00:00 2001 From: Simon Josefsson simon@josefsson.org Date: Fri, 12 Apr 2024 17:25:16 +0200 Subject: [PATCH] gitlog-to-changelog: Make output reproducible.
- build-aux/gitlog-to-changelog: Use gmtime instead of localtime.
ChangeLog | 5 +++++ build-aux/gitlog-to-changelog | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog index cdbb53ff8a..b20f69b06b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2024-04-12 Simon Josefsson simon@josefsson.org + + gitlog-to-changelog: Make output reproducible. + * build-aux/gitlog-to-changelog: Use gmtime instead of localtime. + 2024-04-12 Bruno Haible bruno@clisp.org gnulib-tool.py: Fix parsing of gl_LGPL in gnulib-cache.m4. diff --git a/build-aux/gitlog-to-changelog b/build-aux/gitlog-to-changelog index 16a9405a7c..e06106490c 100755 --- a/build-aux/gitlog-to-changelog +++ b/build-aux/gitlog-to-changelog @@ -35,7 +35,7 @@ eval 'exec perl -wSx "$0" "$@"' if 0; -my $VERSION = '2023-06-24 21:59'; # UTC +my $VERSION = '2024-04-12 15:23'; # UTC # The definition above must lie within the first 8 lines in order # for the Emacs time-stamp write hook (at end) to update it. # If you change this file with Emacs, please let the write hook @@ -360,7 +360,7 @@ sub git_dir_option($) ? ' (tiny change)' : ''); my dateline=sprintf"date_line = sprintf "%s %sdateline=sprintf"tiny\n", - strftime ("%Y-%m-%d", localtime ($1)), $2; + strftime ("%Y-%m-%d", gmtime ($1)), $2; my @coauthors = grep /^Co-authored-by:.*$/, @line; # Omit meta-data lines we've already interpreted.
2.39.2
signature.asc
Description: PGP signature
- [PATCH] gitlog-to-changelog: Make output reproducible.,Simon Josefsson <=
- Re: [PATCH] gitlog-to-changelog: Make output reproducible., Bruno Haible, 2024/04/12
* Re: [PATCH] gitlog-to-changelog: Make output reproducible., Simon Josefsson, 2024/04/12
* Re: [PATCH] gitlog-to-changelog: Make output reproducible., Paul Eggert, 2024/04/12
* Re: [PATCH] gitlog-to-changelog: Make output reproducible., Simon Josefsson, 2024/04/15
- Re: [PATCH] gitlog-to-changelog: Make output reproducible., Bruno Haible, 2024/04/12
- Prev by Date:Re: gnulib-tool.py in jugtail
- Next by Date:Problem with DATADIR on Mingw
- Previous by thread:gnulib-tool.py: Fix parsing of gl_LGPL in gnulib-cache.m4
- Next by thread:Re: [PATCH] gitlog-to-changelog: Make output reproducible.
- Index(es):