git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Localization: Timestamps get wrong if using different locales
@ 2012-08-05  9:08 Christoph Miebach
  2012-08-05 20:47 ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Christoph Miebach @ 2012-08-05  9:08 UTC (permalink / raw)
  To: git

Hello!

Running this commands locally (german locale) lead to some wrong dates 
for the patches upstream.

git format-patch -o patches origin

git send-email --compose --no-chain-reply-to --to some@address.com 
--suppress-cc=author patches/0001-l10n-Turkish-update.patch


The local
Date: Sat, 4 Aug 2012
became
       Wed, 8 Dec 2004

So it looks like matching  DD=04=YY  MM=08=DD  and  YY=12=MM

German date format usually looks DD.MM.YYYY

A workaround for me was running the lines with LANGUAGE=en



I am using
git-send-email 1.7.10.4
with the patch from here
http://www.mail-archive.com/git@vger.kernel.org/msg05240.html
but I do not expect this to do any harm here.

Shall I provide more information?

Regards

Christoph

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Localization: Timestamps get wrong if using different locales
  2012-08-05  9:08 Localization: Timestamps get wrong if using different locales Christoph Miebach
@ 2012-08-05 20:47 ` Junio C Hamano
  2012-08-11 16:22   ` Christoph Miebach
  0 siblings, 1 reply; 3+ messages in thread
From: Junio C Hamano @ 2012-08-05 20:47 UTC (permalink / raw)
  To: Christoph Miebach; +Cc: git

Christoph Miebach <christoph.miebach@web.de> writes:

> Running this commands locally (german locale) lead to some wrong dates
> for the patches upstream.
>
> git format-patch -o patches origin

What does "git show -s --pretty=fuller HEAD" give you at this point?
This is to check what kind of timestamps are stored in the original
commit objects.

And what does "grep '^Date: ' patches/0001-*" show you at this point?
This is to see if the problem is at the "format-patch" step.

> git send-email --compose --no-chain-reply-to --to some@address.com
> --suppress-cc=author patches/0001-l10n-Turkish-update.patch

And what does "grep '^Date: '" for the message that is received by
recipients show at this step?  They cannot be

>
>
> The local
> Date: Sat, 4 Aug 2012
> became
>       Wed, 8 Dec 2004

as these two do not even have times and zones.  It should read
something like

    Date: Sun, 05 Aug 2012 13:39:12 -0700

or something.    

Also "Date" on which message do you see your problem with?  The one
that is created with --compose?  Or the one that was originally
produced by format-patch and then sent?  Or both?

The timestamps used by git-send-email is obtained by calling time()
function of Perl, and is not affected by timezone, and the function
format_2822_time() implements the e-mail header timestamp in a way
that should not be affected by any locales as far as I know, so it
is curious where the "breakage" is coming from.

> Shall I provide more information?

Yes.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Localization: Timestamps get wrong if using different locales
  2012-08-05 20:47 ` Junio C Hamano
@ 2012-08-11 16:22   ` Christoph Miebach
  0 siblings, 0 replies; 3+ messages in thread
From: Christoph Miebach @ 2012-08-11 16:22 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

[-- Attachment #1: Type: text/plain, Size: 2078 bytes --]

Hello!

What I am doing is:
invoking a bash script that does the

git add ${i##$TXPATH/}/strings.xml

git commit --author="$AUTHOR" ${i##$TXPATH\/}/strings.xml -m "l10n: 
$LNAME update"

after a user confirmation.

IIUC setting LANGUAGE=en at the top of this script _did_ help.
So I run everything with german locale for reproducing this.

On 05.08.2012 22:47, Junio C Hamano wrote:
> Christoph Miebach <christoph.miebach@web.de> writes:
>
>> Running this commands locally (german locale) lead to some wrong dates
>> for the patches upstream.
>>
>> git format-patch -o patches origin
>
> What does "git show -s --pretty=fuller HEAD" give you at this point?
> This is to check what kind of timestamps are stored in the original
> commit objects.

See pretty_fuller.txt

> And what does "grep '^Date: ' patches/0001-*" show you at this point?
> This is to see if the problem is at the "format-patch" step.

See date_grep.txt

>> git send-email --compose --no-chain-reply-to --to some@address.com
>> --suppress-cc=author patches/0001-l10n-Turkish-update.patch
>
> And what does "grep '^Date: '" for the message that is received by
> recipients show at this step?  They cannot be
>
>>
>>
>> The local
>> Date: Sat, 4 Aug 2012
>> became
>>        Wed, 8 Dec 2004
>
> as these two do not even have times and zones.  It should read
> something like
>
>      Date: Sun, 05 Aug 2012 13:39:12 -0700
>
> or something.

It was a complete line. I just did not copy all of it, for I thought I 
already pointed out the problem.

The recipient uses en_CA.UTF-8 and guesses:
Date: 12-08-05 06:10 PM
it is Y-M-D, but git thinks it's M-Y-D

> Also "Date" on which message do you see your problem with?  The one
> that is created with --compose?  Or the one that was originally
> produced by format-patch and then sent?  Or both?

git log should show the translators name ($AUTHOR in the git commit line)

Sorry for the late (and probably still incomplete) reply. I can provide 
a complete example or send a patch to a dummy project if you prefer some 
time next week, I hope.

Regards

Christoph


[-- Attachment #2: pretty_fuller.txt --]
[-- Type: text/plain, Size: 271 bytes --]

commit b6f59b4a61f1bd203bb0d449dabac7b16351e2e1
Author:     Christoph Miebach <christoph.miebach@web.de>
AuthorDate: Mon Aug 6 00:07:54 2012 +0200
Commit:     Christoph Miebach <christoph.miebach@web.de>
CommitDate: Mon Aug 6 00:07:54 2012 +0200

    l10n: German update

[-- Attachment #3: date_grep.txt --]
[-- Type: text/plain, Size: 37 bytes --]

Date: Mon, 6 Aug 2012 00:07:54 +0200

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-08-11 16:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-05  9:08 Localization: Timestamps get wrong if using different locales Christoph Miebach
2012-08-05 20:47 ` Junio C Hamano
2012-08-11 16:22   ` Christoph Miebach

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).