Re: [PATCH] am: invoke perl's strftime in C locale
- From
Jeff King <peff@peff.net>
- Date
- Jan 15, 2013, 15:59 UTC
- Message-ID
- <20130115155953.GB21815@sigill.intra.peff.net>
- In-Reply-To
- <20130114205933.GA25947@altlinux.org>
On Tue, Jan 15, 2013 at 12:59:33AM +0400, Dmitry V. Levin wrote:
Show 13 quoted lines
> diff --git a/git-am.sh b/git-am.sh
> index c682d34..64b88e4 100755
> --- a/git-am.sh
> +++ b/git-am.sh
> @@ -334,7 +334,7 @@ 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 }
> + LC_ALL=C perl -M'POSIX qw(strftime)' -ne 'BEGIN { $subject = 0 }
> if ($subject) { print ; }
> elsif (/^\# User /) { s/\# User/From:/ ; print ; }
> elsif (/^\# Date /) {This puts all of perl into the C locale, which would mean error messages from perl would be in English rather than the user's language. It probably isn't a big deal, because that snippet of perl is short and not likely to produce problems, but I wonder how hard it would be to set the locale just for the strftime call.
-Peff