[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn log format description

From: Ben Reser <ben_at_reser.org>
Date: 2004-07-03 21:57:58 CEST

On Sat, Jul 03, 2004 at 11:56:24AM -0700, Robert Kleemann wrote:
> I was writing a program to parse the output of svn log and I needed to
> know whether the "hour" of the date was "0-23" or "1-24". I looked in
> the book: [chp 9 ref].[The subversion command line client].[svn
> subcommands].[svn log] hoping to find some detailed info on the output
> format but didn't find any. I started to look at the source code but
> quickly became lost. Finally I enlisted in the svn project and
> searched for dates that matched either hour 24 or 0.
>
> $ svn co http://svn.collab.net/repos/svn/trunk svn
> $ cd svn
> $ for f in subversion/clients/cmdline/* ; do svn log $f ; done > out
> $ grep ^r out | egrep ' (00|24):'
> r1430 | gstein | 2002-03-06 00:10:52 -0800 (Wed, 06 Mar 2002) | 39 lines
> r1055 | daniel | 2002-01-25 00:52:59 -0800 (Fri, 25 Jan 2002) | 44 lines
> r1055 | daniel | 2002-01-25 00:52:59 -0800 (Fri, 25 Jan 2002) | 44 lines
> ... etc ...
>
> Anyway, this wasn't that big of a deal but it would be nice if one of
> the examples listed in the svn log chapter showed at least one log
> entry for the hour past midnight.

Our own documentation on this:

/* Our human representation of dates looks like this:
 *
 * "2002-06-23 11:13:02 +0300 (Sun, 23 Jun 2002)"
 *
 * This format is used whenever time is shown to the user. It consists
 * of a machine parseable, almost ISO-8601, part in the beginning -
 * and a human explanatory part at the end. The machine parseable part
 * is generated strictly by APR and our code, with a apr_snprintf. The
 * human explanatory part is generated by apr_strftime, which means
 * that its generation can be affected by locale, it can fail and it
 * doesn't need to be constant in size. In other words, perfect to be
 * converted to a configuration option later on.

Where we differ from ISO-8601 is we place a space between the time and
the time zone.

Per ISO-8601, both 24:00 and 00:00 are valid, both of these refer to the
same exact time:
2002-06-23 24:00:00
2002-06-24 00:00:00

However, we always will use the latter form. If for no other reason
than computers in general don't think that way. :)

-- 
Ben Reser <ben@reser.org>
http://ben.reser.org
"Conscience is the inner voice which warns us somebody may be looking."
- H.L. Mencken
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Jul 3 21:59:12 2004

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.