From: Bruno Haible <bruno@clisp.org>
To: git@vger.kernel.org
Subject: git-cvsserver: log dates ignore timezone
Date: Sun, 23 Mar 2008 11:36:40 +0100 [thread overview]
Message-ID: <200803231136.40542.bruno@clisp.org> (raw)
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
reply other threads:[~2008-03-23 10:39 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200803231136.40542.bruno@clisp.org \
--to=bruno@clisp.org \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* 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).