Thread (3 messages) flat view 3 messages, 3 authors, 2016-06-15

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

From: Jeff King <hidden>
Date: 2016-06-15 22:55:49

On Fri, Jan 18, 2013 at 12:36:46PM -0800, Junio C Hamano wrote:
quoted
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help