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

Re: [PATCH v3] am: invoke perl's strftime in C locale

From
Jeff King <peff@peff.net>
Date
Jan 19, 2013, 16:39 UTC
Message-ID
<20130119163940.GA12307@sigill.intra.peff.net>
In-Reply-To
<7vehhiqlcx.fsf@alter.siamese.dyndns.org>
On Fri, Jan 18, 2013 at 12:36:46PM -0800, Junio C Hamano wrote:
Show 14 quoted lines
> > diff --git a/git-am.sh b/git-am.sh
> > index c682d34..8677d8c 100755
> > --- a/git-am.sh
> > +++ b/git-am.sh
> > @@ -334,7 +334,8 @@ split_patches () {
> >  			# Since we cannot guarantee that the commit message is in
> >  			# git-friendly format, we put no Subject: line and just consume
> >  			# all of the message as the body
> > -			perl -M'POSIX qw(strftime)' -ne 'BEGIN { $subject = 0 }
> > +			perl -M'POSIX qw(strftime :locale_h)' -ne '
> > +				BEGIN { setlocale(LC_TIME, "C"); $subject = 0 }
> 
> I still haven't convinced myself that this is an improvement over
> the simple "LC_ALL=C LANG=C perl ..." approach.

Yeah, I was the one who brought it up, but I think I was probably being too nit-picky. It almost certainly doesn't matter, and the alternatives are just as likely to cause problems.

> I am tempted to use the previous one that puts the whole process
> under LC_ALL=C instead, unless I hear a "we already depend on that
> elsewhere, look at $that_code".
I'm fine with that.
-Peff
Previous: Junio C HamanoNext: Dmitry V. Levin
Message 10 of 13 in “am: invoke perl's strftime in C locale”
  1. am: invoke perl's strftime in C localeDmitry V. Levin, Jan 14, 2013
  2. Junio C HamanoJan 14, 2013
  3. am: invoke perl's strftime in C localeDmitry V. Levin, Jan 14, 2013
  4. Jeff KingJan 15, 2013
  5. Antoine PelisseJan 15, 2013
  6. Jeff KingJan 15, 2013
  7. Dmitry V. LevinJan 15, 2013
  8. am: invoke perl's strftime in C localeDmitry V. Levin, Jan 15, 2013
  9. Junio C HamanoJan 18, 2013
  10. Jeff KingJan 19, 2013
  11. Dmitry V. LevinJan 19, 2013
  12. Junio C HamanoJan 20, 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.