archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <>
To: Ghanshyam Thakkar <>
Cc: Achu Luma <>,,,
	 Christian Couder <>,
	Johannes Schindelin <>
Subject: Re: [Outreachy][PATCH 2/2] Port helper/test-date.c to unit-tests/t-date.c
Date: Thu, 28 Mar 2024 09:35:39 -0700	[thread overview]
Message-ID: <xmqqttkquxes.fsf@gitster.g> (raw)
In-Reply-To: <tpaamfc3g5mrrbfufyvxi67ja2ko2hiihrptwxkbmdx4qpid3f@7aashrngiscn> (Ghanshyam Thakkar's message of "Thu, 28 Mar 2024 18:05:59 +0530")

Ghanshyam Thakkar <> writes:

> I believe the issue might not be related to the setenv function, but rather
> with tzset(). As you can see here[1], when we set TZ before we call the
> unit-testing binaries, the tests which were failing (EST5 ones that I
> separated with t-datetest) pass on 'win test (0)', and the ones which
> were passing (UTC ones, t-date) fail. (Although some tests on linux are also
> failing, but that can be explained by the fact that t-date runs first
> and sets the TZ to UTC, afterwhich t-datetest runs and fails, although
> this is not conclusive). Therefore, I am almost certain that the issue
> is with changing the timezone during runtime on windows and not with setting
> TZ variable with setenv(). CC'ing Johannes to see if he has any insights
> on this.

Interesting.  Sometime before I started working on Git, I learned
that no program did tzset() after it started running to switch
multiple timezones and worked correctly on many different variants
of UNIXes (there were many of them back then), and because I never
got interested in writing a world-clock program, I didn't know, and
kind of surprised to learn that it works on some platforms (like
Linux and macOS) to switch zones with tzset() these days ;-).

So, if Windows runtime is unhappy with the program calling tzset()
more than once, I wouldn't be too surprised.


  reply	other threads:[~2024-03-28 16:35 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-05 16:25 [Outreachy][PATCH 1/2] date: refactor 64 bit prereq code into reusable functions Achu Luma
2024-02-05 16:25 ` [Outreachy][PATCH 2/2] Port helper/test-date.c to unit-tests/t-date.c Achu Luma
2024-03-28 12:35   ` Ghanshyam Thakkar
2024-03-28 16:35     ` Junio C Hamano [this message]
2024-05-28 13:20       ` Patrick Steinhardt
2024-05-28 16:41         ` Junio C Hamano
2024-05-29  5:49           ` Patrick Steinhardt
2024-06-27  6:49             ` Johannes Schindelin
2024-02-05 17:34 ` [Outreachy][PATCH 1/2] date: refactor 64 bit prereq code into reusable functions rsbecker
2024-02-06  8:39   ` Christian Couder

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqttkquxes.fsf@gitster.g \ \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).