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

Short date format (Was: Re: I like the new output of 'ls')

From: Nuutti Kotivuori <naked_at_iki.fi>
Date: 2002-07-29 20:47:35 CEST

Garrett Rooney wrote:
> On Fri, Jul 26, 2002 at 09:30:06PM -0500, Karl Fogel wrote:
>> Garrett Rooney <rooneg@electricjellyfish.net> writes:
>>> i believe that Nuutti Kotivuori was planning on making the date
>>> format configurable in the future (at least the comments in
>>> libsvn_subr/time.c seem to give that impression), so i'd say that
>>> when that is done we should just add two options, one for long
>>> and one for short.

Actually, I was not. I was planning on letting somebody do the
configuration file support and decide on the ways how random places of
code can easily access those variables - and then nudging him in the
direction of "Hey, there's a variable you can easily use."

>> That is to say:
>> One format string that Subversion uses when it thinks it's printing
>> a short date, and another format string that it uses when it thinks
>> it's printing a long date, and we just set reasonable defaults for
>> both of them? In other words, a particularly obtuse human could
>> set the "short" format string such that it results in a longer date
>> string than the long format, if they really wanted to.
>> (I think that's what you meant, just want to make sure.)
> yes, that's what i meant. they could set whatever kind of format
> string they want, but if they pick something really long for the
> short one then it'll probably get truncated all over the place.

One very important distinction _must_ be made here. The output of
svn_time_to_human_nts is (regardless of the name of the function)
machine-parseable. It does contain a strict beginning string that
should not be allowed to be customizable, that will always stay
machine parseable. The latter part of the format can be customized as
wished ofcourse.

Now, the format of svn_time_to_short_human_nts, that cannot very well
be machine parseable, since there isn't just enough room for a static
part. So that has to be user configurable and respecting locales -
just like 'ls' is. This is a function that is not just a cool
addition, but a function that is really needed.

And the customizable formats of these functions (or only the latter
part in the long format) should be separate - since on the log
messages, one may want to have only the weekday (Wednesday) after the
format, where as the short format may be something entirely different.

And if we think about machine-parseability, the verbose format of 'svn
ls' really doesn't need to be machine-parseable. If it's a machine, it
wants to do a non-verbose ls to get the file names - and then work on
those. And a '--xml' switch can ofcourse be added later if someone
wants it.

So, in short:

Let's make svn_time_to_short_human_nts! Let's make the latter part of
the long format and the short format customizable by users! Let's make
'svn ls -v' just as clipping and user defined we want - and let's make
'svn ls' to have a machine-parseable output!

Yay, life is good!

-- Naked

To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Jul 29 20:50:24 2002

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.