Re: [PATCH 3/3] Avoid non-portable strftime format specifiers in git-cvsimport

2013-01-15 Thread Chris Rorvick
On Tue, Jan 15, 2013 at 5:10 PM, Ben Walton  wrote:
> Neither %s or %z are portable strftime format specifiers.  There is no
> need for %s in git-cvsimport as the supplied time is already in
> seconds since the epoch.  For %z, use the function get_tz_offset
> provided by Git.pm instead.

Out of curiosity, which platforms are affected?  Assuming DST is a 1
hour shift (patch 2/3) is not necessarily portable either, though this
currently appears to only affect a small island off of the coast of
Australia.  :-)

Chris
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 3/3] Avoid non-portable strftime format specifiers in git-cvsimport

2013-01-16 Thread Ben Walton
On Wed, Jan 16, 2013 at 1:53 AM, Chris Rorvick  wrote:
> On Tue, Jan 15, 2013 at 5:10 PM, Ben Walton  wrote:
>> Neither %s or %z are portable strftime format specifiers.  There is no
>> need for %s in git-cvsimport as the supplied time is already in
>> seconds since the epoch.  For %z, use the function get_tz_offset
>> provided by Git.pm instead.
>
> Out of curiosity, which platforms are affected?  Assuming DST is a 1
> hour shift (patch 2/3) is not necessarily portable either, though this
> currently appears to only affect a small island off of the coast of
> Australia.  :-)

My primary motivation on this change was for solaris.  %s isn't
supported in 10 (not sure about 11) and %z was only added in 10.  The
issue affects other older platforms as well.

Good point about the 1 hour assumption.  Is it worth hacking in
additional logic to handle Lord Howe Island?  I think it's likely a
case of "in for a penny, in for a pound" but that could lead to
madness when it comes to time zones.  Either way, the function behaves
better now than before.

(I wasn't aware of the half hour oddball wrt to DST, so I learned
something new here too!)

Thanks
-Ben
--
---
Take the risk of thinking for yourself.  Much more happiness,
truth, beauty and wisdom will come to you that way.

-Christopher Hitchens
---
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 3/3] Avoid non-portable strftime format specifiers in git-cvsimport

2013-02-09 Thread Junio C Hamano
Ben Walton  writes:

> Neither %s or %z are portable strftime format specifiers.

Well, at least %z is in POSIX; "Some implementations of strftime(3)
lack support for %z format" is fine, tough.

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html