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

git-cvsserver: log dates ignore timezone

From
BHBruno Haible <bruno@clisp.org>
Date
Mar 23, 2008, 10:36 UTC
Message-ID
<200803231136.40542.bruno@clisp.org>
Hi,

In the "cvs log" output produced by git-cvsserver, the revision dates lack the time zone, making it appear that sometimes newer commits were done at older dates. For example, in the gnulib repository, "cvs log ChangeLog" shows:

   ----------------------------
   revision 1.2444
   date: 2008/03/20 09:24:13;  author: Eric;  state: Exp;  lines: +2 -3
   ...
   ----------------------------
   revision 1.2443
   date: 2008/03/20 15:50:57;  author: Simon;  state: Exp;  lines: +2 -3
   ...
   ----------------------------
   revision 1.2442
   date: 2008/03/20 06:52:53;  author: Eric;  state: Exp;  lines: +2 -3
   ...
15:50:57 is not between 06:52:53 and 09:24:13.
The corresponding "git log ChangeLog" shows the dates with timezone:
   commit 8b7bf418dde380e1d311ee68338a75182f2f4080
   Author: Eric Blake <ebb9@byu.net>
   Date:   Thu Mar 20 09:24:13 2008 -0600
   ...
   commit 216173c7d70cbd66f8791b6710cb8f8c3bf6eef9
   Author: Simon Josefsson <simon@josefsson.org>
   Date:   Thu Mar 20 15:50:57 2008 +0100
   ...
   commit 8a1a492ae9389b6b450b2f8a32550e0ddbe3957a
   Author: Eric Blake <ebb9@byu.net>
   Date:   Thu Mar 20 06:52:53 2008 -0600
This happens at git-cvsserver.perl line 1710:
            $revision->{modified} = sprintf('%04d/%02d/%02d %s', $3, $DATE_LIST->{$2}, $1, $4 ) if ( $revision->{modified} =~ /(\d+)\s+(\w+)\s+(\d+)\s+(\S+)/ and defined($DATE_LIST->{$2}) );
$revision->{modified}, originally "20 Mar 2008 09:24:13 -0600", is
transformed into "2008/03/20 09:24:13" by this line of code.
The date format used by the original "cvs" server program is:
  - cvs 1.12.9 and newer use the format "2008-03-20 15:24:13 +0000",
  - older cvs versions use the format   "2008/03/20 15:24:13"
I.e. in both cases it shows the date in GMT time zone.
Could git-cvsserver be changed to do the same thing? I.e. instead of
   ----------------------------
   revision 1.2444
   date: 2008/03/20 09:24:13;  author: Eric;  state: Exp;  lines: +2 -3
   ...
   ----------------------------
   revision 1.2443
   date: 2008/03/20 15:50:57;  author: Simon;  state: Exp;  lines: +2 -3
   ...
   ----------------------------
   revision 1.2442
   date: 2008/03/20 06:52:53;  author: Eric;  state: Exp;  lines: +2 -3
   ...
it should output
   ----------------------------
   revision 1.2444
   date: 2008/03/20 15:24:13;  author: Eric;  state: Exp;  lines: +2 -3
   ...
   ----------------------------
   revision 1.2443
   date: 2008/03/20 14:50:57;  author: Simon;  state: Exp;  lines: +2 -3
   ...
   ----------------------------
   revision 1.2442
   date: 2008/03/20 12:52:53;  author: Eric;  state: Exp;  lines: +2 -3
   ...

This would make the times grow continually, and be in line with what the "cvs" program does. As mentioned above, all that needs to be changed is line 1710 of git-cvsserver.perl.

Bruno
[1] http://cvs.savannah.nongnu.org/viewvc/ccvs/src/log.c?root=cvs&r1=1.95&r2=1.96
Message 1 of 1 in “git-cvsserver: log dates ignore timezone”
  1. Bruno HaibleMar 23, 2008

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.