{"thread":{"id":"31188","subject":"Localization: Timestamps get wrong if using different locales","startedAt":"2012-08-05T09:08:56Z","lastAt":"2012-08-11T16:22:35Z","messageCount":3,"participants":["Christoph Miebach","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"196484","messageId":"501E3828.40708@web.de","threadId":"31188","inReplyTo":null,"subject":"Localization: Timestamps get wrong if using different locales","fromName":"Christoph Miebach","fromEmail":"christoph.miebach@web.de","sentAt":"2012-08-05T09:08:56Z","receivedAt":"2012-08-05T09:08:56Z","isPatch":false,"sender":{"key":"christoph.miebach@web.de","avatar":null},"body":"Hello!\n\nRunning this commands locally (german locale) lead to some wrong dates \nfor the patches upstream.\n\ngit format-patch -o patches origin\n\ngit send-email --compose --no-chain-reply-to --to some@address.com \n--suppress-cc=author patches/0001-l10n-Turkish-update.patch\n\n\nThe local\nDate: Sat, 4 Aug 2012\nbecame\n       Wed, 8 Dec 2004\n\nSo it looks like matching  DD=04=YY  MM=08=DD  and  YY=12=MM\n\nGerman date format usually looks DD.MM.YYYY\n\nA workaround for me was running the lines with LANGUAGE=en\n\n\n\nI am using\ngit-send-email 1.7.10.4\nwith the patch from here\nhttp://www.mail-archive.com/git@vger.kernel.org/msg05240.html\nbut I do not expect this to do any harm here.\n\nShall I provide more information?\n\nRegards\n\nChristoph\n"},{"id":"196500","messageId":"7vmx292hi8.fsf@alter.siamese.dyndns.org","threadId":"31188","inReplyTo":"501E3828.40708@web.de","subject":"Re: Localization: Timestamps get wrong if using different locales","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-08-05T20:47:27Z","receivedAt":"2012-08-05T20:47:27Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Christoph Miebach <christoph.miebach@web.de> writes:\n\n> Running this commands locally (german locale) lead to some wrong dates\n> for the patches upstream.\n>\n> git format-patch -o patches origin\n\nWhat does \"git show -s --pretty=fuller HEAD\" give you at this point?\nThis is to check what kind of timestamps are stored in the original\ncommit objects.\n\nAnd what does \"grep '^Date: ' patches/0001-*\" show you at this point?\nThis is to see if the problem is at the \"format-patch\" step.\n\n> git send-email --compose --no-chain-reply-to --to some@address.com\n> --suppress-cc=author patches/0001-l10n-Turkish-update.patch\n\nAnd what does \"grep '^Date: '\" for the message that is received by\nrecipients show at this step?  They cannot be\n\n>\n>\n> The local\n> Date: Sat, 4 Aug 2012\n> became\n>       Wed, 8 Dec 2004\n\nas these two do not even have times and zones.  It should read\nsomething like\n\n    Date: Sun, 05 Aug 2012 13:39:12 -0700\n\nor something.    \n\nAlso \"Date\" on which message do you see your problem with?  The one\nthat is created with --compose?  Or the one that was originally\nproduced by format-patch and then sent?  Or both?\n\nThe timestamps used by git-send-email is obtained by calling time()\nfunction of Perl, and is not affected by timezone, and the function\nformat_2822_time() implements the e-mail header timestamp in a way\nthat should not be affected by any locales as far as I know, so it\nis curious where the \"breakage\" is coming from.\n\n> Shall I provide more information?\n\nYes.\n"},{"id":"196862","messageId":"502686CB.1070703@web.de","threadId":"31188","inReplyTo":"7vmx292hi8.fsf@alter.siamese.dyndns.org","subject":"Re: Localization: Timestamps get wrong if using different locales","fromName":"Christoph Miebach","fromEmail":"christoph.miebach@web.de","sentAt":"2012-08-11T16:22:35Z","receivedAt":"2012-08-11T16:22:35Z","isPatch":false,"sender":{"key":"christoph.miebach@web.de","avatar":null},"body":"Hello!\n\nWhat I am doing is:\ninvoking a bash script that does the\n\ngit add ${i##$TXPATH/}/strings.xml\n\ngit commit --author=\"$AUTHOR\" ${i##$TXPATH\\/}/strings.xml -m \"l10n: \n$LNAME update\"\n\nafter a user confirmation.\n\nIIUC setting LANGUAGE=en at the top of this script _did_ help.\nSo I run everything with german locale for reproducing this.\n\nOn 05.08.2012 22:47, Junio C Hamano wrote:\n> Christoph Miebach <christoph.miebach@web.de> writes:\n>\n>> Running this commands locally (german locale) lead to some wrong dates\n>> for the patches upstream.\n>>\n>> git format-patch -o patches origin\n>\n> What does \"git show -s --pretty=fuller HEAD\" give you at this point?\n> This is to check what kind of timestamps are stored in the original\n> commit objects.\n\nSee pretty_fuller.txt\n\n> And what does \"grep '^Date: ' patches/0001-*\" show you at this point?\n> This is to see if the problem is at the \"format-patch\" step.\n\nSee date_grep.txt\n\n>> git send-email --compose --no-chain-reply-to --to some@address.com\n>> --suppress-cc=author patches/0001-l10n-Turkish-update.patch\n>\n> And what does \"grep '^Date: '\" for the message that is received by\n> recipients show at this step?  They cannot be\n>\n>>\n>>\n>> The local\n>> Date: Sat, 4 Aug 2012\n>> became\n>>        Wed, 8 Dec 2004\n>\n> as these two do not even have times and zones.  It should read\n> something like\n>\n>      Date: Sun, 05 Aug 2012 13:39:12 -0700\n>\n> or something.\n\nIt was a complete line. I just did not copy all of it, for I thought I \nalready pointed out the problem.\n\nThe recipient uses en_CA.UTF-8 and guesses:\nDate: 12-08-05 06:10 PM\nit is Y-M-D, but git thinks it's M-Y-D\n\n> Also \"Date\" on which message do you see your problem with?  The one\n> that is created with --compose?  Or the one that was originally\n> produced by format-patch and then sent?  Or both?\n\ngit log should show the translators name ($AUTHOR in the git commit line)\n\nSorry for the late (and probably still incomplete) reply. I can provide \na complete example or send a patch to a dummy project if you prefer some \ntime next week, I hope.\n\nRegards\n\nChristoph\n\n\n\ncommit b6f59b4a61f1bd203bb0d449dabac7b16351e2e1\nAuthor:     Christoph Miebach <christoph.miebach@web.de>\nAuthorDate: Mon Aug 6 00:07:54 2012 +0200\nCommit:     Christoph Miebach <christoph.miebach@web.de>\nCommitDate: Mon Aug 6 00:07:54 2012 +0200\n\n    l10n: German update\n\n\nDate: Mon, 6 Aug 2012 00:07:54 +0200\n"}]}