From: Stefan Sperling Subject: Re: got-notify-http: use a UNIX timestamp for the date To: Omar Polo Cc: gameoftrees@openbsd.org Date: Tue, 23 Apr 2024 09:33:19 +0200 On Tue, Apr 23, 2024 at 08:55:51AM +0200, Omar Polo wrote: > This was suggested by Lucas some time ago. I think it makes more sense > and is less error-prone to use a UNIX timestamp rather than a formatted > string for the date (javascript Date.toJSON() notwithstanding.) > > The upside is that got-notify-email has to do some light parsing of the > content of the mail to pretty-print the timestamp. Not a problem. > There is also the assumption that a time_t is at least 64 bit wide, and > I don't know how to portably work around it. Casting to (long long) is fine. > diff /home/op/w/got > commit - 533c404ec30ef30690b8c41481cbdbbeeb8e2a5c > path + /home/op/w/got > blob - a346ab5981dac6f616103dfdb281f5c2785c60a2 > file + gotd/gotd.conf.5 > --- gotd/gotd.conf.5 > +++ gotd/gotd.conf.5 > @@ -402,14 +402,7 @@ Has the same fields as the > .Dv committer > but may be unset. > .It Dv date > -String representation of the date as > -.Xr strftime 3 > -.Sq %G-%m-%d > -if > -.Dv short > -is set or > -.Sq %a %b %e %X %Y UTC > -otherwise. > +Number, representing the number of seconds since the Epoch. Should say: "Epoch in UTC." > .It Dv short_message > The first line of the commit message. > This field is always set. > @@ -474,7 +467,7 @@ field for the > .Dv commit > notification but with all the field guaranteed to be set. > .It Dv date > -The tag date. > +Number, representing the number of seconds since the Epoch. Same. ok stsp@