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

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

From
Ben Walton <bdwalton@gmail.com>
Date
Jan 16, 2013, 10:38 UTC
Message-ID
<CAP30j153s970=2WKqxWTVGRAaJ9jEXg9ETF8OFU=-nDK=BAxfg@mail.gmail.com>
In-Reply-To
<CAEUsAPZakGKUmQWrsTaF1cpbQm0Y4C3sDxCWD_i1gkQxeC-bRQ@mail.gmail.com>
On Wed, Jan 16, 2013 at 1:53 AM, Chris Rorvick <chris@rorvick.com> wrote:
Show 10 quoted lines
> On Tue, Jan 15, 2013 at 5:10 PM, Ben Walton <bdwalton@gmail.com> 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 ---------------------------------------------------------------------------------------------------------------------------

Previous: Chris RorvickNext: Junio C Hamano
Message 12 of 13 in “Fix a portability issue with git-cvsimport”
  1. 0/3 Fix a portability issue with git-cvsimportBen Walton, Jan 15, 2013
  2. 1/3 Move Git::SVN::get_tz to Git::get_tz_offsetBen Walton, Jan 15, 2013
  3. Junio C HamanoJan 16, 2013
  4. Ben WaltonJan 16, 2013
  5. Junio C HamanoJan 16, 2013
  6. 2/3 Allow Git::get_tz_offset to properly handle DST boundary timesBen Walton, Jan 15, 2013
  7. Junio C HamanoJan 17, 2013
  8. Ben WaltonJan 20, 2013
  9. Junio C HamanoJan 20, 2013
  10. 3/3 Avoid non-portable strftime format specifiers in git-cvsimportBen Walton, Jan 15, 2013
  11. Chris RorvickJan 16, 2013
  12. Ben WaltonJan 16, 2013
  13. Junio C HamanoJan 15, 2013

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.