All of lore.kernel.org
 help / color / mirror / Atom feed
* Question about timezones in commit & tag dates
@ 2021-09-12 11:35 Fabian Stelzer
  2021-09-12 14:21 ` Ævar Arnfjörð Bjarmason
  0 siblings, 1 reply; 4+ messages in thread
From: Fabian Stelzer @ 2021-09-12 11:35 UTC (permalink / raw)
  To: Git List

Hi,
while working on correct key rollover and verifying signatures for past
commits for the ssh signing topic i am trying to understand how Git
deals with timestamps for commits & tags.
For ssh signing the user will manage expiration times within their
allowedSigners file. Those timestamps do not carry a timezone and i
would assume a user (or automatic generation of this file) will assume
the systems timezone for them.
Therefore i wanted to pass the commit & tags timestamps adjusted to the
system timezone to make sure key rollover will have no gaps or failed
verification's especially when commit and system timezone differ greatly
and might roll over to another day.

However the commit & tags structs only seem to carry the objects
timestamp as is, simply ignoring any timezone information. For the ssh
feature i can easily enough parse the ident line again from the object
header. But while looking at the usage of the existing date fields i can
see that objects are sometimes sorted on and compared by these dates.
When commands provide cut off times (--since) i think they might include
or exclude commits erroneously when they were made in a different
timezone around the cutoff date. ("log --since" indeed gives me some
unexpected results when mixing multiple timezones. Based on some simple
testing i think it just stops output when a commit falls outside of this
window, even though there might be one before it wich is within)

Is my understanding of this correct and this the expected behaviour?
I think generally for git this does not matter much. But in certain
situations this is problematic.

I would have assumed that git would either add the timezone as well or
adjust the commit timestamp upon populating the date field in the commit
struct to UTC but i could not find anything like it.

Best regards,
Fabian

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-09-12 16:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-12 11:35 Question about timezones in commit & tag dates Fabian Stelzer
2021-09-12 14:21 ` Ævar Arnfjörð Bjarmason
2021-09-12 15:07   ` Fabian Stelzer
2021-09-12 16:16     ` Philip Oakley

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.