{"thread":{"id":"46389","subject":"[L10N] Kickoff of translation for Git 2.14.0 round 1","startedAt":"2017-07-15T05:06:25Z","lastAt":"2017-07-25T20:49:59Z","messageCount":45,"participants":["Jiang Xin","Jean-Noël Avila","Johannes Schindelin","Junio C Hamano","Jordi Mas","Kaartic Sivaraam","Jean-Noël AVILA"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"324567","messageId":"CANYiYbET27mNrZZTNmn_dKBHLLEb4wJiznZ2O1X=WQ_GtamN7w@mail.gmail.com","threadId":"46389","inReplyTo":null,"subject":"[L10N] Kickoff of translation for Git 2.14.0 round 1","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2017-07-15T05:06:19Z","receivedAt":"2017-07-15T05:06:25Z","isPatch":false,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"Hi,\n\nGit v2.14.0-rc0 has been released, and it's time to start new round of git l10n.\nThis time there are 30+ updated messages need to be translated since last\nupdate:\n\n    l10n: git.pot: v2.14.0 round 1 (34 new, 23 removed)\n\n    Generate po/git.pot from v2.14.0-rc0 for git v2.14.0 l10n round 1.\n\n    Signed-off-by: Jiang Xin <worldhello.net@gmail.com>\n\nYou can get it from the usual place:\n\n    https://github.com/git-l10n/git-po/\n\nAs how to update your XX.po and help to translate Git, please see\n\"Updating a XX.po file\" and other sections in “po/README\" file.\n\n--\nJiang Xin\n"},{"id":"324587","messageId":"249ac6f8-af3c-4b20-5bf0-87a82866cc7a@free.fr","threadId":"46389","inReplyTo":"CANYiYbET27mNrZZTNmn_dKBHLLEb4wJiznZ2O1X=WQ_GtamN7w@mail.gmail.com","subject":"Re: [L10N] Kickoff of translation for Git 2.14.0 round 1","fromName":"Jean-Noël Avila","fromEmail":"jn.avila@free.fr","sentAt":"2017-07-15T19:30:19Z","receivedAt":"2017-07-15T19:31:03Z","isPatch":false,"sender":{"key":"jn.avila@free.fr","avatar":"https://avatars.githubusercontent.com/u/156172?v=4"},"body":"Le 15/07/2017 à 07:06, Jiang Xin a écrit :\n> Hi,\n>\n> Git v2.14.0-rc0 has been released, and it's time to start new round of git l10n.\n> This time there are 30+ updated messages need to be translated since last\n> update:\n>\n>     l10n: git.pot: v2.14.0 round 1 (34 new, 23 removed)\n>\n>     Generate po/git.pot from v2.14.0-rc0 for git v2.14.0 l10n round 1.\n>\n>     Signed-off-by: Jiang Xin <worldhello.net@gmail.com>\n>\n> You can get it from the usual place:\n>\n>     https://github.com/git-l10n/git-po/\n>\n> As how to update your XX.po and help to translate Git, please see\n> \"Updating a XX.po file\" and other sections in “po/README\" file.\n>\n> --\n> Jiang Xin\nHi all,\n\n\nA few remarks on i18n:\n\n * commit cb71f8bdb5 (\"PRItime: introduce a new \"printf format\" for\ntimestamps\") does not play well with i18n framework. The static string\nconcatenation cannot be correctly interpreted by msgmerge. I don't know\nhow we can combine variable format indicators with translatable strings.\n\n * commit 4ddb1354e8 (\"status: contextually notify user about an initial\ncommit\") plays sentence lego while introducing colorization which again\ndoes not play well with i18n.\n\n\nThank you.\n\n"},{"id":"324637","messageId":"CANYiYbGyCbzxPuiUUD5XBo2zAfKiZ9XQcEu_=s8XxsMGP1J4Og@mail.gmail.com","threadId":"46389","inReplyTo":"249ac6f8-af3c-4b20-5bf0-87a82866cc7a@free.fr","subject":"Re: [L10N] Kickoff of translation for Git 2.14.0 round 1","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2017-07-17T00:56:53Z","receivedAt":"2017-07-17T00:56:58Z","isPatch":false,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"2017-07-16 3:30 GMT+08:00 Jean-Noël Avila <jn.avila@free.fr>:\n>\n>\n> A few remarks on i18n:\n>\n>  * commit cb71f8bdb5 (\"PRItime: introduce a new \"printf format\" for\n> timestamps\") does not play well with i18n framework. The static string\n> concatenation cannot be correctly interpreted by msgmerge. I don't know\n> how we can combine variable format indicators with translatable strings.\n>\n\nWe can add a new wrapper for raw timestamp like:\n\n    +const char *format_raw_time(timestamp_t time)\n    +{\n    +       static struct strbuf time_buf = STRBUF_INIT;\n    +\n    +       strbuf_reset(&time_buf);\n    +       strbuf_addf(&time_buf, \"%\"PRItime, time);\n    +       return time_buf.buf;\n    +}\n\n\n, and replace macro PRItime in i18n messages with format_raw_time\nwrapper, like this:\n\n    -                       strbuf_addf(&sb, Q_(\"%\"PRItime\" year\",\n\"%\"PRItime\" years\", years), years);\n    +                       strbuf_addf(&sb, Q_(\"%s year\", \"%s years\",\nyears), format_raw_time(years));\n\n\n\n\n-- \nJiang Xin\n"},{"id":"324642","messageId":"3ccfa2fb49d471f807d77d9a280e4b7cfe56faea.1500304209.git.worldhello.net@gmail.com","threadId":"46389","inReplyTo":"249ac6f8-af3c-4b20-5bf0-87a82866cc7a@free.fr","subject":"[PATCH] PRItime: wrap PRItime for better l10n compatibility","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2017-07-17T15:23:43Z","receivedAt":"2017-07-17T15:25:33Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"Commit cb71f8bdb5 (\"PRItime: introduce a new \"printf format\" for\ntimestamps\", 2017-04-21) does not play well with i18n framework. The\nstatic string concatenation cannot be correctly interpreted by\ngettext utilities, such as xgettext.\n\nWrap PRItime in format_raw_time() function, so that we can extract\ncorrect l10n messages into \"po/git.pot\".\n\nReported-by: Jean-Noël Avila <jn.avila@free.fr>\nSigned-off-by: Jiang Xin <worldhello.net@gmail.com>\n---\n archive-zip.c          |  4 ++--\n builtin/blame.c        |  4 ++--\n builtin/fsck.c         |  3 ++-\n builtin/log.c          |  4 ++--\n builtin/receive-pack.c |  4 ++--\n builtin/rev-parse.c    |  2 +-\n cache.h                |  1 +\n date.c                 | 63 ++++++++++++++++++++++++++++++++------------------\n fetch-pack.c           |  2 +-\n refs/files-backend.c   |  6 ++---\n upload-pack.c          |  2 +-\n vcs-svn/fast_export.c  |  8 ++++---\n 12 files changed, 63 insertions(+), 40 deletions(-)\n\ndiff --git a/archive-zip.c b/archive-zip.c\nindex e8913e5a26..92df24815e 100644\n--- a/archive-zip.c\n+++ b/archive-zip.c\n@@ -600,8 +600,8 @@ static void dos_time(timestamp_t *timestamp, int *dos_date, int *dos_time)\n \tstruct tm *t;\n \n \tif (date_overflows(*timestamp))\n-\t\tdie(\"timestamp too large for this system: %\"PRItime,\n-\t\t    *timestamp);\n+\t\tdie(\"timestamp too large for this system: %s\",\n+\t\t    format_raw_time(*timestamp));\n \ttime = (time_t)*timestamp;\n \tt = localtime(&time);\n \t*timestamp = time;\ndiff --git a/builtin/blame.c b/builtin/blame.c\nindex bda1a78726..97bd99dd51 100644\n--- a/builtin/blame.c\n+++ b/builtin/blame.c\n@@ -245,11 +245,11 @@ static int emit_one_suspect_detail(struct blame_origin *suspect, int repeat)\n \tget_commit_info(suspect->commit, &ci, 1);\n \tprintf(\"author %s\\n\", ci.author.buf);\n \tprintf(\"author-mail %s\\n\", ci.author_mail.buf);\n-\tprintf(\"author-time %\"PRItime\"\\n\", ci.author_time);\n+\tprintf(\"author-time %s\\n\", format_raw_time(ci.author_time));\n \tprintf(\"author-tz %s\\n\", ci.author_tz.buf);\n \tprintf(\"committer %s\\n\", ci.committer.buf);\n \tprintf(\"committer-mail %s\\n\", ci.committer_mail.buf);\n-\tprintf(\"committer-time %\"PRItime\"\\n\", ci.committer_time);\n+\tprintf(\"committer-time %s\\n\", format_raw_time(ci.committer_time));\n \tprintf(\"committer-tz %s\\n\", ci.committer_tz.buf);\n \tprintf(\"summary %s\\n\", ci.summary.buf);\n \tif (suspect->commit->object.flags & UNINTERESTING)\ndiff --git a/builtin/fsck.c b/builtin/fsck.c\nindex 99dea7adf6..1f6fc674c3 100644\n--- a/builtin/fsck.c\n+++ b/builtin/fsck.c\n@@ -407,7 +407,8 @@ static void fsck_handle_reflog_oid(const char *refname, struct object_id *oid,\n \t\t\tif (timestamp && name_objects)\n \t\t\t\tadd_decoration(fsck_walk_options.object_names,\n \t\t\t\t\tobj,\n-\t\t\t\t\txstrfmt(\"%s@{%\"PRItime\"}\", refname, timestamp));\n+\t\t\t\t\txstrfmt(\"%s@{%s}\", refname,\n+\t\t\t\t\t\tformat_raw_time(timestamp)));\n \t\t\tobj->used = 1;\n \t\t\tmark_object_reachable(obj);\n \t\t} else {\ndiff --git a/builtin/log.c b/builtin/log.c\nindex c6362cf92e..83b303f8af 100644\n--- a/builtin/log.c\n+++ b/builtin/log.c\n@@ -920,8 +920,8 @@ static void get_patch_ids(struct rev_info *rev, struct patch_ids *ids)\n static void gen_message_id(struct rev_info *info, char *base)\n {\n \tstruct strbuf buf = STRBUF_INIT;\n-\tstrbuf_addf(&buf, \"%s.%\"PRItime\".git.%s\", base,\n-\t\t    (timestamp_t) time(NULL),\n+\tstrbuf_addf(&buf, \"%s.%s.git.%s\", base,\n+\t\t    format_raw_time((timestamp_t) time(NULL)),\n \t\t    git_committer_info(IDENT_NO_NAME|IDENT_NO_DATE|IDENT_STRICT));\n \tinfo->message_id = strbuf_detach(&buf, NULL);\n }\ndiff --git a/builtin/receive-pack.c b/builtin/receive-pack.c\nindex cabdc55e09..75f26a1bc5 100644\n--- a/builtin/receive-pack.c\n+++ b/builtin/receive-pack.c\n@@ -460,12 +460,12 @@ static char *prepare_push_cert_nonce(const char *path, timestamp_t stamp)\n \tstruct strbuf buf = STRBUF_INIT;\n \tunsigned char sha1[20];\n \n-\tstrbuf_addf(&buf, \"%s:%\"PRItime, path, stamp);\n+\tstrbuf_addf(&buf, \"%s:%s\", path, format_raw_time(stamp));\n \thmac_sha1(sha1, buf.buf, buf.len, cert_nonce_seed, strlen(cert_nonce_seed));;\n \tstrbuf_release(&buf);\n \n \t/* RFC 2104 5. HMAC-SHA1-80 */\n-\tstrbuf_addf(&buf, \"%\"PRItime\"-%.*s\", stamp, 20, sha1_to_hex(sha1));\n+\tstrbuf_addf(&buf, \"%s-%.*s\", format_raw_time(stamp), 20, sha1_to_hex(sha1));\n \treturn strbuf_detach(&buf, NULL);\n }\n \ndiff --git a/builtin/rev-parse.c b/builtin/rev-parse.c\nindex c78b7b33d6..c55872196f 100644\n--- a/builtin/rev-parse.c\n+++ b/builtin/rev-parse.c\n@@ -219,7 +219,7 @@ static void show_datestring(const char *flag, const char *datestr)\n \t/* date handling requires both flags and revs */\n \tif ((filter & (DO_FLAGS | DO_REVS)) != (DO_FLAGS | DO_REVS))\n \t\treturn;\n-\tbuffer = xstrfmt(\"%s%\"PRItime, flag, approxidate(datestr));\n+\tbuffer = xstrfmt(\"%s%s\", flag, format_raw_time(approxidate(datestr)));\n \tshow(buffer);\n \tfree(buffer);\n }\ndiff --git a/cache.h b/cache.h\nindex 71fe092644..ff0d9c77a7 100644\n--- a/cache.h\n+++ b/cache.h\n@@ -1428,6 +1428,7 @@ struct date_mode {\n #define DATE_MODE(t) date_mode_from_type(DATE_##t)\n struct date_mode *date_mode_from_type(enum date_mode_type type);\n \n+const char *format_raw_time(timestamp_t time);\n const char *show_date(timestamp_t time, int timezone, const struct date_mode *mode);\n void show_date_relative(timestamp_t time, int tz, const struct timeval *now,\n \t\t\tstruct strbuf *timebuf);\ndiff --git a/date.c b/date.c\nindex c3e673fd04..161489903c 100644\n--- a/date.c\n+++ b/date.c\n@@ -49,13 +49,15 @@ static time_t gm_time_t(timestamp_t time, int tz)\n \n \tif (minutes > 0) {\n \t\tif (unsigned_add_overflows(time, minutes * 60))\n-\t\t\tdie(\"Timestamp+tz too large: %\"PRItime\" +%04d\",\n-\t\t\t    time, tz);\n+\t\t\tdie(\"Timestamp+tz too large: %s +%04d\",\n+\t\t\t    format_raw_time(time), tz);\n \t} else if (time < -minutes * 60)\n-\t\tdie(\"Timestamp before Unix epoch: %\"PRItime\" %04d\", time, tz);\n+\t\tdie(\"Timestamp before Unix epoch: %s %04d\",\n+\t\t    format_raw_time(time), tz);\n \ttime += minutes * 60;\n \tif (date_overflows(time))\n-\t\tdie(\"Timestamp too large for this system: %\"PRItime, time);\n+\t\tdie(\"Timestamp too large for this system: %s\",\n+\t\t    format_raw_time(time));\n \treturn (time_t)time;\n }\n \n@@ -87,7 +89,8 @@ static int local_tzoffset(timestamp_t time)\n \tint offset, eastwest;\n \n \tif (date_overflows(time))\n-\t\tdie(\"Timestamp too large for this system: %\"PRItime, time);\n+\t\tdie(\"Timestamp too large for this system: %s\",\n+\t\t    format_raw_time(time));\n \n \tt = (time_t)time;\n \tlocaltime_r(&t, &tm);\n@@ -119,42 +122,46 @@ void show_date_relative(timestamp_t time, int tz,\n \tdiff = now->tv_sec - time;\n \tif (diff < 90) {\n \t\tstrbuf_addf(timebuf,\n-\t\t\t Q_(\"%\"PRItime\" second ago\", \"%\"PRItime\" seconds ago\", diff), diff);\n+\t\t\t Q_(\"%s second ago\", \"%s seconds ago\", diff),\n+\t\t\t format_raw_time(diff));\n \t\treturn;\n \t}\n \t/* Turn it into minutes */\n \tdiff = (diff + 30) / 60;\n \tif (diff < 90) {\n \t\tstrbuf_addf(timebuf,\n-\t\t\t Q_(\"%\"PRItime\" minute ago\", \"%\"PRItime\" minutes ago\", diff), diff);\n+\t\t\t Q_(\"%s minute ago\", \"%s minutes ago\", diff),\n+\t\t\t format_raw_time(diff));\n \t\treturn;\n \t}\n \t/* Turn it into hours */\n \tdiff = (diff + 30) / 60;\n \tif (diff < 36) {\n \t\tstrbuf_addf(timebuf,\n-\t\t\t Q_(\"%\"PRItime\" hour ago\", \"%\"PRItime\" hours ago\", diff), diff);\n+\t\t\t Q_(\"%s hour ago\", \"%s hours ago\", diff),\n+\t\t\t format_raw_time(diff));\n \t\treturn;\n \t}\n \t/* We deal with number of days from here on */\n \tdiff = (diff + 12) / 24;\n \tif (diff < 14) {\n \t\tstrbuf_addf(timebuf,\n-\t\t\t Q_(\"%\"PRItime\" day ago\", \"%\"PRItime\" days ago\", diff), diff);\n+\t\t\t Q_(\"%s day ago\", \"%s days ago\", diff),\n+\t\t\t format_raw_time(diff));\n \t\treturn;\n \t}\n \t/* Say weeks for the past 10 weeks or so */\n \tif (diff < 70) {\n \t\tstrbuf_addf(timebuf,\n-\t\t\t Q_(\"%\"PRItime\" week ago\", \"%\"PRItime\" weeks ago\", (diff + 3) / 7),\n-\t\t\t (diff + 3) / 7);\n+\t\t\t Q_(\"%s week ago\", \"%s weeks ago\", (diff + 3) / 7),\n+\t\t\t format_raw_time((diff + 3) / 7));\n \t\treturn;\n \t}\n \t/* Say months for the past 12 months or so */\n \tif (diff < 365) {\n \t\tstrbuf_addf(timebuf,\n-\t\t\t Q_(\"%\"PRItime\" month ago\", \"%\"PRItime\" months ago\", (diff + 15) / 30),\n-\t\t\t (diff + 15) / 30);\n+\t\t\t Q_(\"%s month ago\", \"%s months ago\", (diff + 15) / 30),\n+\t\t\t format_raw_time((diff + 15) / 30));\n \t\treturn;\n \t}\n \t/* Give years and months for 5 years or so */\n@@ -164,21 +171,23 @@ void show_date_relative(timestamp_t time, int tz,\n \t\ttimestamp_t months = totalmonths % 12;\n \t\tif (months) {\n \t\t\tstruct strbuf sb = STRBUF_INIT;\n-\t\t\tstrbuf_addf(&sb, Q_(\"%\"PRItime\" year\", \"%\"PRItime\" years\", years), years);\n+\t\t\tstrbuf_addf(&sb, Q_(\"%s year\", \"%s years\", years),\n+\t\t\t\tformat_raw_time(years));\n \t\t\tstrbuf_addf(timebuf,\n \t\t\t\t /* TRANSLATORS: \"%s\" is \"<n> years\" */\n-\t\t\t\t Q_(\"%s, %\"PRItime\" month ago\", \"%s, %\"PRItime\" months ago\", months),\n-\t\t\t\t sb.buf, months);\n+\t\t\t\t Q_(\"%s, %s month ago\", \"%s, %s months ago\", months),\n+\t\t\t\t sb.buf, format_raw_time(months));\n \t\t\tstrbuf_release(&sb);\n \t\t} else\n \t\t\tstrbuf_addf(timebuf,\n-\t\t\t\t Q_(\"%\"PRItime\" year ago\", \"%\"PRItime\" years ago\", years), years);\n+\t\t\t\t Q_(\"%s year ago\", \"%s years ago\", years),\n+\t\t\t\t format_raw_time(years));\n \t\treturn;\n \t}\n \t/* Otherwise, just years. Centuries is probably overkill. */\n \tstrbuf_addf(timebuf,\n-\t\t Q_(\"%\"PRItime\" year ago\", \"%\"PRItime\" years ago\", (diff + 183) / 365),\n-\t\t (diff + 183) / 365);\n+\t\t Q_(\"%s year ago\", \"%s years ago\", (diff + 183) / 365),\n+\t\t format_raw_time((diff + 183) / 365));\n }\n \n struct date_mode *date_mode_from_type(enum date_mode_type type)\n@@ -191,6 +200,15 @@ struct date_mode *date_mode_from_type(enum date_mode_type type)\n \treturn &mode;\n }\n \n+const char *format_raw_time(timestamp_t time)\n+{\n+\tstatic struct strbuf time_buf = STRBUF_INIT;\n+\n+\tstrbuf_reset(&time_buf);\n+\tstrbuf_addf(&time_buf, \"%\"PRItime, time);\n+\treturn time_buf.buf;\n+}\n+\n const char *show_date(timestamp_t time, int tz, const struct date_mode *mode)\n {\n \tstruct tm *tm;\n@@ -198,7 +216,7 @@ const char *show_date(timestamp_t time, int tz, const struct date_mode *mode)\n \n \tif (mode->type == DATE_UNIX) {\n \t\tstrbuf_reset(&timebuf);\n-\t\tstrbuf_addf(&timebuf, \"%\"PRItime, time);\n+\t\tstrbuf_addstr(&timebuf, format_raw_time(time));\n \t\treturn timebuf.buf;\n \t}\n \n@@ -207,7 +225,7 @@ const char *show_date(timestamp_t time, int tz, const struct date_mode *mode)\n \n \tif (mode->type == DATE_RAW) {\n \t\tstrbuf_reset(&timebuf);\n-\t\tstrbuf_addf(&timebuf, \"%\"PRItime\" %+05d\", time, tz);\n+\t\tstrbuf_addf(&timebuf, \"%s %+05d\", format_raw_time(time), tz);\n \t\treturn timebuf.buf;\n \t}\n \n@@ -666,7 +684,8 @@ static void date_string(timestamp_t date, int offset, struct strbuf *buf)\n \t\toffset = -offset;\n \t\tsign = '-';\n \t}\n-\tstrbuf_addf(buf, \"%\"PRItime\" %c%02d%02d\", date, sign, offset / 60, offset % 60);\n+\tstrbuf_addf(buf, \"%s %c%02d%02d\", format_raw_time(date), sign,\n+\t\toffset / 60, offset % 60);\n }\n \n /*\ndiff --git a/fetch-pack.c b/fetch-pack.c\nindex fbbc99c888..80c4ec27df 100644\n--- a/fetch-pack.c\n+++ b/fetch-pack.c\n@@ -397,7 +397,7 @@ static int find_common(struct fetch_pack_args *args,\n \t\tpacket_buf_write(&req_buf, \"deepen %d\", args->depth);\n \tif (args->deepen_since) {\n \t\ttimestamp_t max_age = approxidate(args->deepen_since);\n-\t\tpacket_buf_write(&req_buf, \"deepen-since %\"PRItime, max_age);\n+\t\tpacket_buf_write(&req_buf, \"deepen-since %s\", format_raw_time(max_age));\n \t}\n \tif (args->deepen_not) {\n \t\tint i;\ndiff --git a/refs/files-backend.c b/refs/files-backend.c\nindex 0404f2c233..3872ef33e7 100644\n--- a/refs/files-backend.c\n+++ b/refs/files-backend.c\n@@ -3236,9 +3236,9 @@ static int expire_reflog_ent(struct object_id *ooid, struct object_id *noid,\n \t\t\tprintf(\"prune %s\", message);\n \t} else {\n \t\tif (cb->newlog) {\n-\t\t\tfprintf(cb->newlog, \"%s %s %s %\"PRItime\" %+05d\\t%s\",\n-\t\t\t\toid_to_hex(ooid), oid_to_hex(noid),\n-\t\t\t\temail, timestamp, tz, message);\n+\t\t\tfprintf(cb->newlog, \"%s %s %s %s %+05d\\t%s\",\n+\t\t\t\toid_to_hex(ooid), oid_to_hex(noid), email,\n+\t\t\t\tformat_raw_time(timestamp), tz, message);\n \t\t\toidcpy(&cb->last_kept_oid, noid);\n \t\t}\n \t\tif (cb->flags & EXPIRE_REFLOGS_VERBOSE)\ndiff --git a/upload-pack.c b/upload-pack.c\nindex 7efff2fbfd..cfcc79a9cd 100644\n--- a/upload-pack.c\n+++ b/upload-pack.c\n@@ -864,7 +864,7 @@ static void receive_needs(void)\n \n \t\targv_array_push(&av, \"rev-list\");\n \t\tif (deepen_since)\n-\t\t\targv_array_pushf(&av, \"--max-age=%\"PRItime, deepen_since);\n+\t\t\targv_array_pushf(&av, \"--max-age=%s\", format_raw_time(deepen_since));\n \t\tif (deepen_not.nr) {\n \t\t\targv_array_push(&av, \"--not\");\n \t\t\tfor (i = 0; i < deepen_not.nr; i++) {\ndiff --git a/vcs-svn/fast_export.c b/vcs-svn/fast_export.c\nindex 5a89db30e3..291f294e30 100644\n--- a/vcs-svn/fast_export.c\n+++ b/vcs-svn/fast_export.c\n@@ -73,7 +73,8 @@ void fast_export_begin_note(uint32_t revision, const char *author,\n \tstatic int firstnote = 1;\n \tsize_t loglen = strlen(log);\n \tprintf(\"commit %s\\n\", note_ref);\n-\tprintf(\"committer %s <%s@%s> %\"PRItime\" +0000\\n\", author, author, \"local\", timestamp);\n+\tprintf(\"committer %s <%s@%s> %s +0000\\n\", author, author, \"local\",\n+\t\tformat_raw_time(timestamp));\n \tprintf(\"data %\"PRIuMAX\"\\n\", (uintmax_t)loglen);\n \tfwrite(log, loglen, 1, stdout);\n \tif (firstnote) {\n@@ -107,10 +108,11 @@ void fast_export_begin_commit(uint32_t revision, const char *author,\n \t}\n \tprintf(\"commit %s\\n\", local_ref);\n \tprintf(\"mark :%\"PRIu32\"\\n\", revision);\n-\tprintf(\"committer %s <%s@%s> %\"PRItime\" +0000\\n\",\n+\tprintf(\"committer %s <%s@%s> %s +0000\\n\",\n \t\t   *author ? author : \"nobody\",\n \t\t   *author ? author : \"nobody\",\n-\t\t   *uuid ? uuid : \"local\", timestamp);\n+\t\t   *uuid ? uuid : \"local\",\n+\t\t   format_raw_time(timestamp));\n \tprintf(\"data %\"PRIuMAX\"\\n\",\n \t\t(uintmax_t) (log->len + strlen(gitsvnline)));\n \tfwrite(log->buf, log->len, 1, stdout);\n-- \n2.14.0.rc0.1.g3ccfa2fb49\n\n"},{"id":"324647","messageId":"alpine.DEB.2.21.1.1707171805460.4193@virtualbox","threadId":"46389","inReplyTo":"CANYiYbGyCbzxPuiUUD5XBo2zAfKiZ9XQcEu_=s8XxsMGP1J4Og@mail.gmail.com","subject":"Re: [L10N] Kickoff of translation for Git 2.14.0 round 1","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2017-07-17T16:06:22Z","receivedAt":"2017-07-17T16:06:35Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Mon, 17 Jul 2017, Jiang Xin wrote:\n\n> 2017-07-16 3:30 GMT+08:00 Jean-Noël Avila <jn.avila@free.fr>:\n> >\n> >\n> > A few remarks on i18n:\n> >\n> >  * commit cb71f8bdb5 (\"PRItime: introduce a new \"printf format\" for\n> > timestamps\") does not play well with i18n framework. The static string\n> > concatenation cannot be correctly interpreted by msgmerge. I don't know\n> > how we can combine variable format indicators with translatable strings.\n> >\n> \n> We can add a new wrapper for raw timestamp like:\n> \n>     +const char *format_raw_time(timestamp_t time)\n>     +{\n>     +       static struct strbuf time_buf = STRBUF_INIT;\n>     +\n>     +       strbuf_reset(&time_buf);\n>     +       strbuf_addf(&time_buf, \"%\"PRItime, time);\n>     +       return time_buf.buf;\n>     +}\n> \n> \n> , and replace macro PRItime in i18n messages with format_raw_time\n> wrapper, like this:\n> \n>     -                       strbuf_addf(&sb, Q_(\"%\"PRItime\" year\",\n> \"%\"PRItime\" years\", years), years);\n>     +                       strbuf_addf(&sb, Q_(\"%s year\", \"%s years\",\n> years), format_raw_time(years));\n\nThat would come at the price of complexifying the code just to accommodate\na translation tool.\n\nHow do you gentle people deal with PRIuMAX?\n\nCiao,\nDscho"},{"id":"324648","messageId":"xmqq7ez7htvj.fsf@gitster.mtv.corp.google.com","threadId":"46389","inReplyTo":"3ccfa2fb49d471f807d77d9a280e4b7cfe56faea.1500304209.git.worldhello.net@gmail.com","subject":"Re: [PATCH] PRItime: wrap PRItime for better l10n compatibility","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-07-17T17:10:24Z","receivedAt":"2017-07-17T17:10:34Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jiang Xin <worldhello.net@gmail.com> writes:\n\n> Commit cb71f8bdb5 (\"PRItime: introduce a new \"printf format\" for\n> timestamps\", 2017-04-21) does not play well with i18n framework. The\n> static string concatenation cannot be correctly interpreted by\n> gettext utilities, such as xgettext.\n>\n> Wrap PRItime in format_raw_time() function, so that we can extract\n> correct l10n messages into \"po/git.pot\".\n>\n> Reported-by: Jean-Noël Avila <jn.avila@free.fr>\n> Signed-off-by: Jiang Xin <worldhello.net@gmail.com>\n> ...\n> @@ -191,6 +200,15 @@ struct date_mode *date_mode_from_type(enum date_mode_type type)\n>  \treturn &mode;\n>  }\n>  \n> +const char *format_raw_time(timestamp_t time)\n> +{\n> +\tstatic struct strbuf time_buf = STRBUF_INIT;\n> +\n> +\tstrbuf_reset(&time_buf);\n> +\tstrbuf_addf(&time_buf, \"%\"PRItime, time);\n> +\treturn time_buf.buf;\n> +}\n\nHmm.\n\nTwo potential issues are:\n\n - After this patch, there still are quite a many \n\n\tprintf(\"time is %\"PRItime\" ...\\n\", timestamp)\n\n   so the burden on the programmers having to remember when it is\n   required to use format_raw_time() becomes unclear, and makes the\n   change/churn larger when an existing message needs to be marked\n   for translation.\n\n - The static struct strbuf here is a cheap way to avoid leaks, but\n   at the same time it is unfriendly to threaded code.  We could\n   instead do:\n\n        void append_PRItime(struct strbuf *buf, timestamp_t time);\n\n   to fix that trivially, but the damage to the caller obviously is\n   much larger going this way.\n\n"},{"id":"324694","messageId":"CANYiYbEE+kmRAuLnDcWfLOJud_9gQuHGo8uZCr3sMFFaWZ987w@mail.gmail.com","threadId":"46389","inReplyTo":"alpine.DEB.2.21.1.1707171805460.4193@virtualbox","subject":"Re: [L10N] Kickoff of translation for Git 2.14.0 round 1","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2017-07-18T01:28:02Z","receivedAt":"2017-07-18T01:28:08Z","isPatch":false,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"2017-07-18 0:06 GMT+08:00 Johannes Schindelin <Johannes.Schindelin@gmx.de>:\n> Hi,\n>\n> On Mon, 17 Jul 2017, Jiang Xin wrote:\n>\n>> 2017-07-16 3:30 GMT+08:00 Jean-Noël Avila <jn.avila@free.fr>:\n>> >\n>> >\n>> > A few remarks on i18n:\n>> >\n>> >  * commit cb71f8bdb5 (\"PRItime: introduce a new \"printf format\" for\n>> > timestamps\") does not play well with i18n framework. The static string\n>> > concatenation cannot be correctly interpreted by msgmerge. I don't know\n>> > how we can combine variable format indicators with translatable strings.\n>> >\n>>\n>> We can add a new wrapper for raw timestamp like:\n>>\n>>     +const char *format_raw_time(timestamp_t time)\n>>     +{\n>>     +       static struct strbuf time_buf = STRBUF_INIT;\n>>     +\n>>     +       strbuf_reset(&time_buf);\n>>     +       strbuf_addf(&time_buf, \"%\"PRItime, time);\n>>     +       return time_buf.buf;\n>>     +}\n>>\n>>\n>> , and replace macro PRItime in i18n messages with format_raw_time\n>> wrapper, like this:\n>>\n>>     -                       strbuf_addf(&sb, Q_(\"%\"PRItime\" year\",\n>> \"%\"PRItime\" years\", years), years);\n>>     +                       strbuf_addf(&sb, Q_(\"%s year\", \"%s years\",\n>> years), format_raw_time(years));\n>\n> That would come at the price of complexifying the code just to accommodate\n> a translation tool.\n>\n> How do you gentle people deal with PRIuMAX?\n\nCan we just use PRIuMAX instead of the macro PRItime?  PRIuMAX can be\nhandled properly by gettext utilities, while PRItime not.\n\nIf replace PRItime to PRIuMAX like this:\n\n    -                        Q_(\"%\"PRItime\" second ago\", \"%\"PRItime\"\nseconds ago\", diff), diff);\n    +                        Q_(\"%\"PRIuMAX\" second ago\", \"%\"PRIuMAX\"\nseconds ago\", diff), diff);\n\nThe above l10n message can be extracted properly by running `make pot`:\n\n    #: date.c:122\n    #, c-format\n    msgid \"%<PRIuMAX> second ago\"\n    msgid_plural \"%<PRIuMAX> seconds ago\"\n    msgstr[0] \"\"\n    msgstr[1] \"\"\n\n> Ciao,\n> Dscho\n\n\n\n-- \nJiang Xin\n"},{"id":"324695","messageId":"CANYiYbEcMrriaor9OT4c2qtfh9Ja5NJ9KBSxa3XhPAuoN0t42A@mail.gmail.com","threadId":"46389","inReplyTo":"xmqq7ez7htvj.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH] PRItime: wrap PRItime for better l10n compatibility","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2017-07-18T01:33:43Z","receivedAt":"2017-07-18T01:33:50Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"2017-07-18 1:10 GMT+08:00 Junio C Hamano <gitster@pobox.com>:\n> Jiang Xin <worldhello.net@gmail.com> writes:\n>\n>> Commit cb71f8bdb5 (\"PRItime: introduce a new \"printf format\" for\n>> timestamps\", 2017-04-21) does not play well with i18n framework. The\n>> static string concatenation cannot be correctly interpreted by\n>> gettext utilities, such as xgettext.\n>>\n>> Wrap PRItime in format_raw_time() function, so that we can extract\n>> correct l10n messages into \"po/git.pot\".\n>>\n>> Reported-by: Jean-Noël Avila <jn.avila@free.fr>\n>> Signed-off-by: Jiang Xin <worldhello.net@gmail.com>\n>> ...\n>> @@ -191,6 +200,15 @@ struct date_mode *date_mode_from_type(enum date_mode_type type)\n>>       return &mode;\n>>  }\n>>\n>> +const char *format_raw_time(timestamp_t time)\n>> +{\n>> +     static struct strbuf time_buf = STRBUF_INIT;\n>> +\n>> +     strbuf_reset(&time_buf);\n>> +     strbuf_addf(&time_buf, \"%\"PRItime, time);\n>> +     return time_buf.buf;\n>> +}\n>\n> Hmm.\n>\n> Two potential issues are:\n>\n>  - After this patch, there still are quite a many\n>\n>         printf(\"time is %\"PRItime\" ...\\n\", timestamp)\n>\n>    so the burden on the programmers having to remember when it is\n>    required to use format_raw_time() becomes unclear, and makes the\n>    change/churn larger when an existing message needs to be marked\n>    for translation.\n>\n>  - The static struct strbuf here is a cheap way to avoid leaks, but\n>    at the same time it is unfriendly to threaded code.  We could\n>    instead do:\n>\n>         void append_PRItime(struct strbuf *buf, timestamp_t time);\n>\n>    to fix that trivially, but the damage to the caller obviously is\n>    much larger going this way.\n>\n\nI wonder if we can replace the original %lu for timestamp with PRIuMAX\ninstead.  PRIuMAX works fine with gettext utils.\n\n-- \nJiang Xin\n"},{"id":"324707","messageId":"xmqq60epfy27.fsf@gitster.mtv.corp.google.com","threadId":"46389","inReplyTo":"CANYiYbEcMrriaor9OT4c2qtfh9Ja5NJ9KBSxa3XhPAuoN0t42A@mail.gmail.com","subject":"Re: [PATCH] PRItime: wrap PRItime for better l10n compatibility","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-07-18T17:35:12Z","receivedAt":"2017-07-18T17:41:05Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jiang Xin <worldhello.net@gmail.com> writes:\n\n>> Two potential issues are:\n>>\n>>  - After this patch, there still are quite a many\n>>\n>>         printf(\"time is %\"PRItime\" ...\\n\", timestamp)\n>>\n>>    so the burden on the programmers having to remember when it is\n>>    required to use format_raw_time() becomes unclear, and makes the\n>>    change/churn larger when an existing message needs to be marked\n>>    for translation.\n>>\n>>  - The static struct strbuf here is a cheap way to avoid leaks, but\n>>    at the same time it is unfriendly to threaded code.  We could\n>>    instead do:\n>>\n>>         void append_PRItime(struct strbuf *buf, timestamp_t time);\n>>\n>>    to fix that trivially, but the damage to the caller obviously is\n>>    much larger going this way.\n>>\n>\n> I wonder if we can replace the original %lu for timestamp with PRIuMAX\n> instead.  PRIuMAX works fine with gettext utils.\n\nI think the question can better be answered if we know how gettext\ntools special case PRIuMAX.  One thing that may be problematic is\nthat timestamp can later become a signed type and use of one level\nof redirection in the current code via PRItime and via timestamp_t\nis a good way to keep such a transition much easier.  Reverting it\nto use PRIuMAX would make such a transition much harder.\n"},{"id":"324756","messageId":"CANYiYbFROuyXso2ZKuJWDp4cSwpBu=bNAbC-yZtEyDwkbUcAhQ@mail.gmail.com","threadId":"46389","inReplyTo":"xmqq60epfy27.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH] PRItime: wrap PRItime for better l10n compatibility","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2017-07-19T00:57:17Z","receivedAt":"2017-07-19T00:57:24Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"2017-07-19 1:35 GMT+08:00 Junio C Hamano <gitster@pobox.com>:\n> Jiang Xin <worldhello.net@gmail.com> writes:\n>\n>>> Two potential issues are:\n>>>\n>>>  - After this patch, there still are quite a many\n>>>\n>>>         printf(\"time is %\"PRItime\" ...\\n\", timestamp)\n>>>\n>>>    so the burden on the programmers having to remember when it is\n>>>    required to use format_raw_time() becomes unclear, and makes the\n>>>    change/churn larger when an existing message needs to be marked\n>>>    for translation.\n>>>\n>>>  - The static struct strbuf here is a cheap way to avoid leaks, but\n>>>    at the same time it is unfriendly to threaded code.  We could\n>>>    instead do:\n>>>\n>>>         void append_PRItime(struct strbuf *buf, timestamp_t time);\n>>>\n>>>    to fix that trivially, but the damage to the caller obviously is\n>>>    much larger going this way.\n>>>\n>>\n>> I wonder if we can replace the original %lu for timestamp with PRIuMAX\n>> instead.  PRIuMAX works fine with gettext utils.\n>\n> I think the question can better be answered if we know how gettext\n> tools special case PRIuMAX.  One thing that may be problematic is\n> that timestamp can later become a signed type and use of one level\n> of redirection in the current code via PRItime and via timestamp_t\n> is a good way to keep such a transition much easier.  Reverting it\n> to use PRIuMAX would make such a transition much harder.\n\nGettext handles macros such as PRIuMAX in commit 8b45c5df1 (\"Add\nsupport for ISO C 99 <inttypes.h> format string directive macros.\",\n2002-07-23 12:33:13 +0000).\n\nMacros such as PRIuMAX are hard coded, and we can not hack gettext\neasily and directly.\n\nFor example, some code in commit 8b45c5df1 (see: See:\nhttp://git.savannah.gnu.org/cgit/gettext.git/commit/?id=8b45c5df18e1976a1275297db73978bfe6144c7e):\n\n    +/* 8a. Convert ISO C 99 section 7.8.1 format string directives to string\n    +   literal placeholders.  */\n    +\n    +/* Test for an ISO C 99 section 7.8.1 format string directive.  */\n    +static bool\n    +is_inttypes_macro (name)\n    +     const char *name;\n    +{\n    +  /* Syntax:\n    +     P R I { d | i | o | u | x | X }\n    +     { { | LEAST | FAST } { 8 | 16 | 32 | 64 } | MAX | PTR }  */\n    +  if (name[0] == 'P' && name[1] == 'R' && name[2] == 'I')\n    +    {\n    +      name += 3;\n    +      if (name[0] == 'd' || name[0] == 'i' || name[0] == 'o' ||\nname[0] == 'u'\n    +          || name[0] == 'x' || name[0] == 'X')\n    +        {\n    +          name += 1;\n    +          if (name[0] == 'M' && name[1] == 'A' && name[2] == 'X'\n    +              && name[3] == '\\0')\n    +            return true;\n    +          if (name[0] == 'P' && name[1] == 'T' && name[2] == 'R'\n    +              && name[3] == '\\0')\n    +            return true;\n    +          if (name[0] == 'L' && name[1] == 'E' && name[2] == 'A'\n    +              && name[3] == 'S' && name[4] == 'T')\n    +            name += 5;\n    +          else if (name[0] == 'F' && name[1] == 'A' && name[2] == 'S'\n    +                   && name[3] == 'T')\n    +            name += 4;\n    +          if (name[0] == '8' && name[1] == '\\0')\n    +            return true;\n    +          if (name[0] == '1' && name[1] == '6' && name[2] == '\\0')\n    +            return true;\n    +          if (name[0] == '3' && name[1] == '2' && name[2] == '\\0')\n    +            return true;\n    +          if (name[0] == '6' && name[1] == '4' && name[2] == '\\0')\n    +            return true;\n    +        }\n    +    }\n    +  return false;\n    +}\n\n\n    + if (*format == '<')\n        {\n    -     if (*format == 'h')\n    +     spec.c99_directives =\n    +       (const char **)\n    +       xrealloc (spec.c99_directives,\n    +                 2 * (spec.c99_directives_count + 1)\n    +                 * sizeof (const char *));\n    +     spec.c99_directives[2 * spec.c99_directives_count] = format;\n    +\n    +     format++;\n    +     /* Parse ISO C 99 section 7.8.1 format string directive.\n    +        Syntax:\n    +        P R I { d | i | o | u | x | X }\n    +        { { | LEAST | FAST } { 8 | 16 | 32 | 64 } | MAX | PTR }  */\n    +     if (*format != 'P')\n    +       goto bad_format;\n    +     format++;\n    +     if (*format != 'R')\n    +       goto bad_format;\n    +     format++;\n    +     if (*format != 'I')\n    +       goto bad_format;\n    +     format++;\n    +\n    +     switch (*format)\n    +       {\n    +       case 'i': case 'd':\n    +         type = FAT_INTEGER;\n    +         break;\n    +       case 'u': case 'o': case 'x': case 'X':\n    +         type = FAT_INTEGER | FAT_UNSIGNED;\n    +         break;\n    +       default:\n    +         goto bad_format;\n    +       }\n    +     format++;\n    +\n    +     if (format[0] == 'M' && format[1] == 'A' && format[2] == 'X')\n    +       {\n    +         type |= FAT_SIZE_INTMAX_T;\n    +         format += 3;\n    +       }\n    +     else if (format[0] == 'P' && format[1] == 'T' && format[2] == 'R')\n\n-- \nJiang Xin\n"},{"id":"324757","messageId":"9f2b1205-01fa-ef7b-81ec-7717103936c7@softcatala.org","threadId":"46389","inReplyTo":"CANYiYbET27mNrZZTNmn_dKBHLLEb4wJiznZ2O1X=WQ_GtamN7w@mail.gmail.com","subject":"Re: [L10N] Kickoff of translation for Git 2.14.0 round 1","fromName":"Jordi Mas","fromEmail":"jmas@softcatala.org","sentAt":"2017-07-19T05:44:54Z","receivedAt":"2017-07-19T05:45:08Z","isPatch":false,"sender":{"key":"jmas@softcatala.org","avatar":"https://avatars.githubusercontent.com/u/309265?v=4"},"body":"El 15/07/2017 a les 07:06, Jiang Xin ha escrit:\n> Hi,\n> \n> Git v2.14.0-rc0 has been released, and it's time to start new round of git l10n.\n> This time there are 30+ updated messages need to be translated since last\n> update:\n> \n>      l10n: git.pot: v2.14.0 round 1 (34 new, 23 removed)\n> \n>      Generate po/git.pot from v2.14.0-rc0 for git v2.14.0 l10n round 1.\n> \n>      Signed-off-by: Jiang Xin <worldhello.net@gmail.com>\n> \n> You can get it from the usual place:\n> \n>      https://github.com/git-l10n/git-po/\n> \n> As how to update your XX.po and help to translate Git, please see\n> \"Updating a XX.po file\" and other sections in “po/README\" file.\n\nHello Jiang,\n\nSometimes I do several commits to complete the translation. However, \ngithub from the UI does not offer me the option to Merge and Squash.\n\nCan you check that you have \"Allow squash merging\" activated for the \nhttps://github.com/git-l10n/git-po repository?\n\nAllowing this from the Github UI will make life more easy.\n\nThanks,\n\nJordi,\n-- \nJordi Mas i Hernàndez -Bloc: http://gent.softcatala.org/jmas/bloc/\nPlanet Softcatalà -> http://planeta.softcatala.org\n\n---\nThis email has been checked for viruses by AVG.\nhttp://www.avg.com\n\n"},{"id":"324761","messageId":"alpine.DEB.2.21.1.1707191456010.4193@virtualbox","threadId":"46389","inReplyTo":"CANYiYbFROuyXso2ZKuJWDp4cSwpBu=bNAbC-yZtEyDwkbUcAhQ@mail.gmail.com","subject":"Re: [PATCH] PRItime: wrap PRItime for better l10n compatibility","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2017-07-19T13:25:09Z","receivedAt":"2017-07-19T13:25:22Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Jian (or is it Xin?),\n\nOn Wed, 19 Jul 2017, Jiang Xin wrote:\n\n> 2017-07-19 1:35 GMT+08:00 Junio C Hamano <gitster@pobox.com>:\n> > Jiang Xin <worldhello.net@gmail.com> writes:\n> >\n> >>> Two potential issues are:\n> >>>\n> >>>  - After this patch, there still are quite a many\n> >>>\n> >>>         printf(\"time is %\"PRItime\" ...\\n\", timestamp)\n> >>>\n> >>>    so the burden on the programmers having to remember when it is\n> >>>    required to use format_raw_time() becomes unclear, and makes the\n> >>>    change/churn larger when an existing message needs to be marked\n> >>>    for translation.\n> >>>\n> >>>  - The static struct strbuf here is a cheap way to avoid leaks, but\n> >>>    at the same time it is unfriendly to threaded code.  We could\n> >>>    instead do:\n> >>>\n> >>>         void append_PRItime(struct strbuf *buf, timestamp_t time);\n> >>>\n> >>>    to fix that trivially, but the damage to the caller obviously is\n> >>>    much larger going this way.\n> >>>\n> >>\n> >> I wonder if we can replace the original %lu for timestamp with PRIuMAX\n> >> instead.  PRIuMAX works fine with gettext utils.\n> >\n> > I think the question can better be answered if we know how gettext\n> > tools special case PRIuMAX.  One thing that may be problematic is\n> > that timestamp can later become a signed type and use of one level\n> > of redirection in the current code via PRItime and via timestamp_t\n> > is a good way to keep such a transition much easier.  Reverting it\n> > to use PRIuMAX would make such a transition much harder.\n> \n> Gettext handles macros such as PRIuMAX in commit 8b45c5df1 (\"Add\n> support for ISO C 99 <inttypes.h> format string directive macros.\",\n> 2002-07-23 12:33:13 +0000).\n\nWow. This is ugly.\n\nIf I understand correctly, then this will not even work correctly for\nPRIuMAX on Windows: I highly doubt that the gettext library will interpret\n%I64u in the format string correctly to be what %<PRIuMAX> in the po file\nrefers to.\n\nBut there may be hope. Since the character sequence \"PRItime\" is highly\nunlikely to occur in Git's source code in any context other than the\nformat to print/parse timestamp_t, it should be possible to automate a the\nstring replacement\n\n\tgit ls-files -z \\*.[ch] |\n\txargs -0r sed -i 's/PRItime/PRIuMAX/g'\n\n(assuming, of course, that you use GNU sed, not BSD sed, for which the\n`-i` needs to read `-i ''` instead) as part of the update?\n\nFor all the reasons Junio mentioned, I, too, would be reluctant to change\nthe source code to cull all of the PRItime mentions, as it is pleasing\nfrom a semantic point of view that we know what the heck we are talking\nabout here.\n\nBTW *thank you so much* for your Herculean effort to keep going with the\ntranslation.\n\nCiao,\nDscho\n"},{"id":"324774","messageId":"xmqqd18wm7t6.fsf@gitster.mtv.corp.google.com","threadId":"46389","inReplyTo":"alpine.DEB.2.21.1.1707191456010.4193@virtualbox","subject":"Re: [PATCH] PRItime: wrap PRItime for better l10n compatibility","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-07-19T21:32:37Z","receivedAt":"2017-07-19T21:32:52Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n>> Gettext handles macros such as PRIuMAX in commit 8b45c5df1 (\"Add\n>> support for ISO C 99 <inttypes.h> format string directive macros.\",\n>> 2002-07-23 12:33:13 +0000).\n>\n> Wow. This is ugly.\n>\n> If I understand correctly, then this will not even work correctly for\n> PRIuMAX on Windows: ...\n\nI think it is the other way around.  Without such a special-casing,\nand producing message identifier that has \"%<PRIuMAX>\" in it, they\ncannot get a .po source that is usable across platforms.\n\nImagine a hypothetical xgettext that does not have the special case,\nbut just does what CPP does.  Running it on a platform where\nuintmax_t is \"unsigned long\" would have \"%lu\" in resulting .po for a\nmessage that uses \"%\" + PRIuMAX.  But the same source compiled on a\nplatform where uintmax_t is larger would pass \"%llu\" in calls to\n_(...) it makes; such a string will not be found at runtime in the\ncorresponding .mo file, because you started with \"%lu\" in the .po\nfile.  By leaving a special marker %<PRIuMAX> in the .po file by\nspecial casing, the toolchain can make sure that the actual\nparameter given to a _(...) can be found at runtime in .mo file that\nwas produced by compiling the .po file for the target platform.\n\nSo our own PRItime was a good idea for maintainability's point of\nview of _our_ code, but it was not very friendly to i18n.\n\nI can see two possibly usable approaches to make it i18n-friendly\nwhile retaining our ability to later change the underlying type of\ntimestamp_t.  But neither is very pretty.\n\n - One is what was in Jiang's earlier proposal.\n\n - Another is to replace PRItime with PRIuMAX _but_ leave a comment\n   to tell us that it wanted to be PRItime, so that we can later\n   \"git grep\" for such a comment if/when we want to update the type\n   of timestamp_t.\n\n"},{"id":"324775","messageId":"xmqq8tjkm3ly.fsf@gitster.mtv.corp.google.com","threadId":"46389","inReplyTo":"alpine.DEB.2.21.1.1707191456010.4193@virtualbox","subject":"Re: [PATCH] PRItime: wrap PRItime for better l10n compatibility","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-07-19T23:03:21Z","receivedAt":"2017-07-19T23:03:31Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> But there may be hope. Since the character sequence \"PRItime\" is highly\n> unlikely to occur in Git's source code in any context other than the\n> format to print/parse timestamp_t, it should be possible to automate a the\n> string replacement\n>\n> \tgit ls-files -z \\*.[ch] |\n> \txargs -0r sed -i 's/PRItime/PRIuMAX/g'\n>\n> (assuming, of course, that you use GNU sed, not BSD sed, for which the\n> `-i` needs to read `-i ''` instead) as part of the update?\n\nI somehow missed this bit.\n\nGiven that this needs to be done only once every release by only one\nperson (i.e. the l10n coordinator who updates *.pot file), as long\nas the procedure is automated as much as possible to ease the pain\nfor the l10n coordinator and clearly described in the \"Maintaining\nthe po/git.pot file\" section of po/README, something along that line\ndoes sound like a very tempting approach.  If it works well, it is\ncertainly much easier for normal developers than the other possible\nalternatives I mentioned in my previous response.\n\nIt is brittle as you already said, but perhaps a bit of anchoring\nlike \\<PRItime\\>, the brittle-ness may not hurt in practice.  \n\nI didn't look at \"git grep PRItime\" output for hits, though.\n\n"},{"id":"324786","messageId":"CANYiYbESKtiAounR3hT-n542qoFcUx90DnMGNk0JGiEq9s47Nw@mail.gmail.com","threadId":"46389","inReplyTo":"9f2b1205-01fa-ef7b-81ec-7717103936c7@softcatala.org","subject":"Re: [L10N] Kickoff of translation for Git 2.14.0 round 1","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2017-07-20T00:50:09Z","receivedAt":"2017-07-20T00:50:15Z","isPatch":false,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"2017-07-19 13:44 GMT+08:00 Jordi Mas <jmas@softcatala.org>:\n> El 15/07/2017 a les 07:06, Jiang Xin ha escrit:\n>>\n>\n> Hello Jiang,\n>\n> Sometimes I do several commits to complete the translation. However, github\n> from the UI does not offer me the option to Merge and Squash.\n>\n> Can you check that you have \"Allow squash merging\" activated for the\n> https://github.com/git-l10n/git-po repository?\n\nYes, it was activated. But I doubt the commit log of the squash merge\nwon't follow our standard.\n\nFor me, I prefer doing an interactive rebase and squashing all the\ncommits into one, and will record the contributors in header of the\nfile and in the commit log message.\n\n>\n> Allowing this from the Github UI will make life more easy.\n>\n> Thanks,\n>\n> Jordi,\n> --\n> Jordi Mas i Hernàndez -Bloc: http://gent.softcatala.org/jmas/bloc/\n> Planet Softcatalà -> http://planeta.softcatala.org\n>\n> ---\n> This email has been checked for viruses by AVG.\n> http://www.avg.com\n>\n\n\n\n-- \nJiang Xin\n"},{"id":"324818","messageId":"xmqqo9sfkm32.fsf@gitster.mtv.corp.google.com","threadId":"46389","inReplyTo":"xmqq8tjkm3ly.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH] PRItime: wrap PRItime for better l10n compatibility","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-07-20T18:19:29Z","receivedAt":"2017-07-20T18:19:37Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n>\n>> But there may be hope. Since the character sequence \"PRItime\" is highly\n>> unlikely to occur in Git's source code in any context other than the\n>> format to print/parse timestamp_t, it should be possible to automate a the\n>> string replacement\n>>\n>> \tgit ls-files -z \\*.[ch] |\n>> \txargs -0r sed -i 's/PRItime/PRIuMAX/g'\n>>\n>> (assuming, of course, that you use GNU sed, not BSD sed, for which the\n>> `-i` needs to read `-i ''` instead) as part of the update?\n>\n> I somehow missed this bit.\n>\n> Given that this needs to be done only once every release by only one\n> person (i.e. the l10n coordinator who updates *.pot file), as long\n> as the procedure is automated as much as possible to ease the pain\n> for the l10n coordinator and clearly described in the \"Maintaining\n> the po/git.pot file\" section of po/README, something along that line\n> does sound like a very tempting approach.  If it works well, it is\n> certainly much easier for normal developers than the other possible\n> alternatives I mentioned in my previous response.\n\nSo, I was offline for most of the day yesterday and with this issue\nblocking the release candidate, didn't manage to tag -rc1.\n\nThe use of \"make pot\" from the top-level is already described in\npo/README, so the only thing that we need is something like this\nchange.  I'll follow up this message with a sample output from the\nupdated process to ask others to sanity check the result (they are\ntiny) in a separate message.\n\nThanks.\n\n\n Makefile | 10 ++++++++++\n 1 file changed, 10 insertions(+)\n\ndiff --git a/Makefile b/Makefile\nindex ba4359ef8d..7069a12f75 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2216,12 +2216,22 @@ LOCALIZED_SH += t/t0200/test.sh\n LOCALIZED_PERL += t/t0200/test.perl\n endif\n \n+## Note that this is only meant to run by the localization coordinator\n+## under a very controlled condition, i.e. (1) it is to be run in a\n+## Git repository (not a tarball extract), (2) any local modifications\n+## will be lost.\n po/git.pot: $(GENERATED_H) FORCE\n+\t@for s in $(LOCALIZED_C) $(LOCALIZED_SH) $(LOCALIZED_PERL); \\\n+\tdo \\\n+\t\tsed -e 's|PRItime|PRIuMAX|g' <\"$$s\" >\"$$s+\" && \\\n+\t\tcat \"$$s+\" >\"$$s\" && rm \"$$s+\"; \\\n+\tdone\n \t$(QUIET_XGETTEXT)$(XGETTEXT) -o$@+ $(XGETTEXT_FLAGS_C) $(LOCALIZED_C)\n \t$(QUIET_XGETTEXT)$(XGETTEXT) -o$@+ --join-existing $(XGETTEXT_FLAGS_SH) \\\n \t\t$(LOCALIZED_SH)\n \t$(QUIET_XGETTEXT)$(XGETTEXT) -o$@+ --join-existing $(XGETTEXT_FLAGS_PERL) \\\n \t\t$(LOCALIZED_PERL)\n+\t@git reset --hard\n \tmv $@+ $@\n \n .PHONY: pot\n"},{"id":"324820","messageId":"xmqqk233klvd.fsf@gitster.mtv.corp.google.com","threadId":"46389","inReplyTo":"xmqqo9sfkm32.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH] PRItime: wrap PRItime for better l10n compatibility","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-07-20T18:24:06Z","receivedAt":"2017-07-20T18:24:15Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> The use of \"make pot\" from the top-level is already described in\n> po/README, so the only thing that we need is something like this\n> change.  I'll follow up this message with a sample output from the\n> updated process to ask others to sanity check the result (they are\n> tiny) in a separate message.\n\nWithout the Makefile patch in the previous message, I ran \"make pot\"\nand saved the resulting po/git.pot to git.pot-old.  And then after\n\"git reset --hard\", I applied the Makefile patch and ran \"make pot\"\nagain, which gave me an updated po/git.pot file.  The difference is\nshown below.\n\nAs expected, these look sensible to me.  All the hits from \n\n\tgit grep '_(.*PRItime'\n\nare included in the difference.\n\n\n\n\n--- git.pot-old\t2017-07-20 11:17:29.608343390 -0700\n+++ po/git.pot\t2017-07-20 11:18:14.744342564 -0700\n@@ -8,7 +8,7 @@\n msgstr \"\"\n \"Project-Id-Version: PACKAGE VERSION\\n\"\n \"Report-Msgid-Bugs-To: Git Mailing List <git@vger.kernel.org>\\n\"\n-\"POT-Creation-Date: 2017-07-20 11:17-0700\\n\"\n+\"POT-Creation-Date: 2017-07-20 11:18-0700\\n\"\n \"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\\n\"\n \"Last-Translator: FULL NAME <EMAIL@ADDRESS>\\n\"\n \"Language-Team: LANGUAGE <LL@li.org>\\n\"\n@@ -1388,17 +1388,67 @@\n msgid \"in the future\"\n msgstr \"\"\n \n-#: date.c:122 date.c:129 date.c:136 date.c:143 date.c:149 date.c:156\n-#: date.c:167 date.c:175 date.c:180\n-msgid \"%\"\n-msgid_plural \"%\"\n+#: date.c:122\n+#, c-format\n+msgid \"%<PRIuMAX> second ago\"\n+msgid_plural \"%<PRIuMAX> seconds ago\"\n+msgstr[0] \"\"\n+msgstr[1] \"\"\n+\n+#: date.c:129\n+#, c-format\n+msgid \"%<PRIuMAX> minute ago\"\n+msgid_plural \"%<PRIuMAX> minutes ago\"\n+msgstr[0] \"\"\n+msgstr[1] \"\"\n+\n+#: date.c:136\n+#, c-format\n+msgid \"%<PRIuMAX> hour ago\"\n+msgid_plural \"%<PRIuMAX> hours ago\"\n+msgstr[0] \"\"\n+msgstr[1] \"\"\n+\n+#: date.c:143\n+#, c-format\n+msgid \"%<PRIuMAX> day ago\"\n+msgid_plural \"%<PRIuMAX> days ago\"\n+msgstr[0] \"\"\n+msgstr[1] \"\"\n+\n+#: date.c:149\n+#, c-format\n+msgid \"%<PRIuMAX> week ago\"\n+msgid_plural \"%<PRIuMAX> weeks ago\"\n+msgstr[0] \"\"\n+msgstr[1] \"\"\n+\n+#: date.c:156\n+#, c-format\n+msgid \"%<PRIuMAX> month ago\"\n+msgid_plural \"%<PRIuMAX> months ago\"\n+msgstr[0] \"\"\n+msgstr[1] \"\"\n+\n+#: date.c:167\n+#, c-format\n+msgid \"%<PRIuMAX> year\"\n+msgid_plural \"%<PRIuMAX> years\"\n msgstr[0] \"\"\n msgstr[1] \"\"\n \n #. TRANSLATORS: \"%s\" is \"<n> years\"\n #: date.c:170\n-msgid \"%s, %\"\n-msgid_plural \"%s, %\"\n+#, c-format\n+msgid \"%s, %<PRIuMAX> month ago\"\n+msgid_plural \"%s, %<PRIuMAX> months ago\"\n+msgstr[0] \"\"\n+msgstr[1] \"\"\n+\n+#: date.c:175 date.c:180\n+#, c-format\n+msgid \"%<PRIuMAX> year ago\"\n+msgid_plural \"%<PRIuMAX> years ago\"\n msgstr[0] \"\"\n msgstr[1] \"\"\n \n"},{"id":"324823","messageId":"xmqqfudrkkci.fsf@gitster.mtv.corp.google.com","threadId":"46389","inReplyTo":"xmqqo9sfkm32.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH] PRItime: wrap PRItime for better l10n compatibility","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-07-20T18:57:01Z","receivedAt":"2017-07-20T18:57:09Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"> The use of \"make pot\" from the top-level is already described in\n> po/README, so the only thing that we need is something like this\n> change.  I'll follow up this message with a sample output from the\n> updated process to ask others to sanity check the result (they are\n> tiny) in a separate message.\n\nSo I am inclined to apply this directly on 'master' before tagging\nthe first release candidate that includes timestamp_t; I'll wait for\nthe earth to rotate once for comments, though.\n\nThanks.\n\n-- >8 --\nSubject: [PATCH] Makefile: help gettext tools to cope with our custom PRItime format\n\nWe started using our own timestamp_t type and PRItime format\nspecifier to go along with it, so that we can later change the\nunderlying type and output format more easily, but this does not\nplay well with gettext tools.\n\nBecause gettext tools need to keep the *.po file portable across\nplatforms, they have to special-case the format specifiers like\nPRIuMAX that are known types in inttypes.h, instead of letting CPP\nhandle strings like\n\n    \"%\" PRIuMAX \" seconds ago\"\n\nas an ordinary string concatenation.  They fundamentally cannot do\nthe same for our own custom type/format.\n\nGiven that po/git.pot needs to be generated only once every release\nand by only one person, i.e. the l10n coordinator, let's update the\nMakefile rule to generate po/git.pot so that gettext tools are run\non a munged set of sources in which all mentions of PRItime are\nreplaced with PRIuMAX, which is what we happen to use right now.\n\nThis way, developers do not have to care that PRItime does not play\nwell with gettext, and translators do not have to care that we use\nour own PRItime.\n\nThe credit for the idea to munge the source files goes to Dscho.\nPossible bugs are mine.\n\nHelped-by: Jiang Xin <worldhello.net@gmail.com>\nHelped-by: Johannes Schindelin <johannes.schindelin@gmx.de>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n Makefile | 20 ++++++++++++++++++++\n 1 file changed, 20 insertions(+)\n\ndiff --git a/Makefile b/Makefile\nindex ba4359ef8d..527502835f 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2216,12 +2216,32 @@ LOCALIZED_SH += t/t0200/test.sh\n LOCALIZED_PERL += t/t0200/test.perl\n endif\n \n+## Note that this is meant to be run only by the localization coordinator\n+## under a very controlled condition, i.e. (1) it is to be run in a\n+## Git repository (not a tarball extract), (2) any local modifications\n+## will be lost.\n+## Gettext tools cannot work with our own custom PRItime type, so\n+## we replace PRItime with PRIuMAX.  Weneed to update this if we\n+## switch to a signed type with PRIdMAX.\n+\n po/git.pot: $(GENERATED_H) FORCE\n+\t# All modifications will be reverted at the end, so we do not\n+\t# want to have any local changes\n+\tgit diff --quiet HEAD && git diff --quiet --cached\n+\n+\t@for s in $(LOCALIZED_C) $(LOCALIZED_SH) $(LOCALIZED_PERL); \\\n+\tdo \\\n+\t\tsed -e 's|PRItime|PRIuMAX|g' <\"$$s\" >\"$$s+\" && \\\n+\t\tcat \"$$s+\" >\"$$s\" && rm \"$$s+\"; \\\n+\tdone\n+\n \t$(QUIET_XGETTEXT)$(XGETTEXT) -o$@+ $(XGETTEXT_FLAGS_C) $(LOCALIZED_C)\n \t$(QUIET_XGETTEXT)$(XGETTEXT) -o$@+ --join-existing $(XGETTEXT_FLAGS_SH) \\\n \t\t$(LOCALIZED_SH)\n \t$(QUIET_XGETTEXT)$(XGETTEXT) -o$@+ --join-existing $(XGETTEXT_FLAGS_PERL) \\\n \t\t$(LOCALIZED_PERL)\n+\n+\tgit reset --hard\n \tmv $@+ $@\n \n .PHONY: pot\n-- \n2.14.0-rc0-194-g965e058453\n\n"},{"id":"324863","messageId":"f00aeb42-75ad-d5ec-b4fb-c80b48827db4@free.fr","threadId":"46389","inReplyTo":"xmqqfudrkkci.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH] PRItime: wrap PRItime for better l10n compatibility","fromName":"Jean-Noël Avila","fromEmail":"jn.avila@free.fr","sentAt":"2017-07-21T14:38:58Z","receivedAt":"2017-07-21T14:41:01Z","isPatch":true,"sender":{"key":"jn.avila@free.fr","avatar":"https://avatars.githubusercontent.com/u/156172?v=4"},"body":"Le 20/07/2017 à 20:57, Junio C Hamano a écrit :\n>\n> +\tgit diff --quiet HEAD && git diff --quiet --cached\n> +\n> +\t@for s in $(LOCALIZED_C) $(LOCALIZED_SH) $(LOCALIZED_PERL); \\\n\nDoes PRIuMAX make sense for perl and sh files?\n\n> +\tdo \\\n> +\t\tsed -e 's|PRItime|PRIuMAX|g' <\"$$s\" >\"$$s+\" && \\\n> +\t\tcat \"$$s+\" >\"$$s\" && rm \"$$s+\"; \\\n> +\tdone\n> +\n>  \t$(QUIET_XGETTEXT)$(XGETTEXT) -o$@+ $(XGETTEXT_FLAGS_C) $(LOCALIZED_C)\n>  \t$(QUIET_XGETTEXT)$(XGETTEXT) -o$@+ --join-existing $(XGETTEXT_FLAGS_SH) \\\n>  \t\t$(LOCALIZED_SH)\n>  \t$(QUIET_XGETTEXT)$(XGETTEXT) -o$@+ --join-existing $(XGETTEXT_FLAGS_PERL) \\\n>  \t\t$(LOCALIZED_PERL)\n> +\n> +\tgit reset --hard\n>  \tmv $@+ $@\n>  \n>  .PHONY: pot\n\n\n"},{"id":"324864","messageId":"xmqq7ez1j0wv.fsf@gitster.mtv.corp.google.com","threadId":"46389","inReplyTo":"f00aeb42-75ad-d5ec-b4fb-c80b48827db4@free.fr","subject":"Re: [PATCH] PRItime: wrap PRItime for better l10n compatibility","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-07-21T14:54:24Z","receivedAt":"2017-07-21T14:55:53Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jean-Noël Avila <jn.avila@free.fr> writes:\n\n> Le 20/07/2017 à 20:57, Junio C Hamano a écrit :\n>>\n>> +\tgit diff --quiet HEAD && git diff --quiet --cached\n>> +\n>> +\t@for s in $(LOCALIZED_C) $(LOCALIZED_SH) $(LOCALIZED_PERL); \\\n>\n> Does PRIuMAX make sense for perl and sh files?\n\nNot really; I did this primarily because I would prefer to keep\nthings consistent, anticipating there may be some other things we\nneed to replace before running gettext(1) for other reasons later.\n\nI do not mind removing them, if Jiang/Dscho already reviewed and\ntested _this_ version (which we do not yet know), I'd prefer not to\ntouch it for the upcoming release.\n\nThanks for reading it over.\n\n\n>> +\tdo \\\n>> +\t\tsed -e 's|PRItime|PRIuMAX|g' <\"$$s\" >\"$$s+\" && \\\n>> +\t\tcat \"$$s+\" >\"$$s\" && rm \"$$s+\"; \\\n>> +\tdone\n>> +\n>>  \t$(QUIET_XGETTEXT)$(XGETTEXT) -o$@+ $(XGETTEXT_FLAGS_C) $(LOCALIZED_C)\n>>  \t$(QUIET_XGETTEXT)$(XGETTEXT) -o$@+ --join-existing $(XGETTEXT_FLAGS_SH) \\\n>>  \t\t$(LOCALIZED_SH)\n>>  \t$(QUIET_XGETTEXT)$(XGETTEXT) -o$@+ --join-existing $(XGETTEXT_FLAGS_PERL) \\\n>>  \t\t$(LOCALIZED_PERL)\n>> +\n>> +\tgit reset --hard\n>>  \tmv $@+ $@\n>>  \n>>  .PHONY: pot\n"},{"id":"324886","messageId":"CANYiYbGSaaFOq7iw=ON1Oo87bSA96o=zyzym5RDT32kMae7bsw@mail.gmail.com","threadId":"46389","inReplyTo":"xmqqo9sfkm32.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH] PRItime: wrap PRItime for better l10n compatibility","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2017-07-21T22:17:52Z","receivedAt":"2017-07-21T22:17:59Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"2017-07-21 2:19 GMT+08:00 Junio C Hamano <gitster@pobox.com>:\n> Junio C Hamano <gitster@pobox.com> writes:\n>\n>> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n>>\n>>> But there may be hope. Since the character sequence \"PRItime\" is highly\n>>> unlikely to occur in Git's source code in any context other than the\n>>> format to print/parse timestamp_t, it should be possible to automate a the\n>>> string replacement\n>>>\n>>>      git ls-files -z \\*.[ch] |\n>>>      xargs -0r sed -i 's/PRItime/PRIuMAX/g'\n>>>\n>>> (assuming, of course, that you use GNU sed, not BSD sed, for which the\n>>> `-i` needs to read `-i ''` instead) as part of the update?\n>>\n>> I somehow missed this bit.\n>>\n>> Given that this needs to be done only once every release by only one\n>> person (i.e. the l10n coordinator who updates *.pot file), as long\n>> as the procedure is automated as much as possible to ease the pain\n>> for the l10n coordinator and clearly described in the \"Maintaining\n>> the po/git.pot file\" section of po/README, something along that line\n>> does sound like a very tempting approach.  If it works well, it is\n>> certainly much easier for normal developers than the other possible\n>> alternatives I mentioned in my previous response.\n>\n> So, I was offline for most of the day yesterday and with this issue\n> blocking the release candidate, didn't manage to tag -rc1.\n>\n> The use of \"make pot\" from the top-level is already described in\n> po/README, so the only thing that we need is something like this\n> change.  I'll follow up this message with a sample output from the\n> updated process to ask others to sanity check the result (they are\n> tiny) in a separate message.\n>\n> Thanks.\n>\n>\n>  Makefile | 10 ++++++++++\n>  1 file changed, 10 insertions(+)\n>\n> diff --git a/Makefile b/Makefile\n> index ba4359ef8d..7069a12f75 100644\n> --- a/Makefile\n> +++ b/Makefile\n> @@ -2216,12 +2216,22 @@ LOCALIZED_SH += t/t0200/test.sh\n>  LOCALIZED_PERL += t/t0200/test.perl\n>  endif\n>\n> +## Note that this is only meant to run by the localization coordinator\n> +## under a very controlled condition, i.e. (1) it is to be run in a\n> +## Git repository (not a tarball extract), (2) any local modifications\n> +## will be lost.\n>  po/git.pot: $(GENERATED_H) FORCE\n> +       @for s in $(LOCALIZED_C) $(LOCALIZED_SH) $(LOCALIZED_PERL); \\\n> +       do \\\n> +               sed -e 's|PRItime|PRIuMAX|g' <\"$$s\" >\"$$s+\" && \\\n> +               cat \"$$s+\" >\"$$s\" && rm \"$$s+\"; \\\n> +       done\n>         $(QUIET_XGETTEXT)$(XGETTEXT) -o$@+ $(XGETTEXT_FLAGS_C) $(LOCALIZED_C)\n>         $(QUIET_XGETTEXT)$(XGETTEXT) -o$@+ --join-existing $(XGETTEXT_FLAGS_SH) \\\n>                 $(LOCALIZED_SH)\n>         $(QUIET_XGETTEXT)$(XGETTEXT) -o$@+ --join-existing $(XGETTEXT_FLAGS_PERL) \\\n>                 $(LOCALIZED_PERL)\n> +       @git reset --hard\n>         mv $@+ $@\n>\n>  .PHONY: pot\n\nSorry, I'm late. I want to try a safer way to change PRItime to\nPRInMax using a hacked version of gettext.\n\nWe can change Makefile like this:\n\n    --- a/Makefile\n    +++ b/Makefile\n    @@ -2216,7 +2216,14 @@ LOCALIZED_SH += t/t0200/test.sh\n     LOCALIZED_PERL += t/t0200/test.perl\n     endif\n\n    -po/git.pot: $(GENERATED_H) FORCE\n    +check_gettext:\n    +       @if ! $(XGETTEXT) --version | grep -q -i PRItime; then \\\n    +               echo >&2 \"Error: must use a hacked xgettext, which\ncan handle PRItime macro properly.\"; \\\n    +               echo >&2 \"Error: download the hacked version of\ngettext from https://github.com/......\" ; \\\n    +               exit 1; \\\n    +       fi\n    +\n    +po/git.pot: check_gettext $(GENERATED_H) FORCE\n           $(QUIET_XGETTEXT)$(XGETTEXT) -o$@+ $(XGETTEXT_FLAGS_C) $(LOCALIZED_C)\n           $(QUIET_XGETTEXT)$(XGETTEXT) -o$@+ --join-existing\n$(XGETTEXT_FLAGS_SH) \\\n                   $(LOCALIZED_SH)\n\nBut I'm not sure I can handle this in this very busy weekend.\n\n-- \nJiang Xin\n"},{"id":"324887","messageId":"xmqqvamlfm6s.fsf@gitster.mtv.corp.google.com","threadId":"46389","inReplyTo":"CANYiYbGSaaFOq7iw=ON1Oo87bSA96o=zyzym5RDT32kMae7bsw@mail.gmail.com","subject":"Re: [PATCH] PRItime: wrap PRItime for better l10n compatibility","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-07-21T22:40:43Z","receivedAt":"2017-07-21T22:40:58Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jiang Xin <worldhello.net@gmail.com> writes:\n\n> Sorry, I'm late. I want to try a safer way to change PRItime to\n> PRInMax using a hacked version of gettext.\n\nWhy?  A vanilla version of gettext tool that is fed a known PRIuMAX\nin its input would be a safer choice, I would have thought.\n\nI've already queued the patch you responded to on 'master', but\nhaven't tagged -rc1 yet, so it is possible for you to update on top\nof it before -rc1 is tagged.  I do not yet understand why you think\na modified version of gettext would be a safer way to go, though.\n\nThanks.\n"},{"id":"324888","messageId":"CANYiYbF+XDANNbpZJ-jL7y81QhggW_snBuWeONSCUc4CPn2zMw@mail.gmail.com","threadId":"46389","inReplyTo":"xmqqvamlfm6s.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH] PRItime: wrap PRItime for better l10n compatibility","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2017-07-21T23:13:50Z","receivedAt":"2017-07-21T23:13:56Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"2017-07-22 6:40 GMT+08:00 Junio C Hamano <gitster@pobox.com>:\n> Jiang Xin <worldhello.net@gmail.com> writes:\n>\n>> Sorry, I'm late. I want to try a safer way to change PRItime to\n>> PRInMax using a hacked version of gettext.\n>\n> Why?  A vanilla version of gettext tool that is fed a known PRIuMAX\n> in its input would be a safer choice, I would have thought.\n>\n> I've already queued the patch you responded to on 'master', but\n> haven't tagged -rc1 yet, so it is possible for you to update on top\n> of it before -rc1 is tagged.  I do not yet understand why you think\n> a modified version of gettext would be a safer way to go, though.\n>\n> Thanks.\n\nA very small hack on gettext.  When extract l10n messages to pot file\nwith `xgettext`, will grep \"PRItime\", and do \"sed s/PRItime/PRIuMAX\"\ninside `xgettext`.\n\nSee this patch:\nhttps://github.com/jiangxin/gettext/commit/b0a726431c93b5a1ca0fe749de376b0752e75fb0\n\n    ---\n     gettext-tools/src/x-c.c      | 17 ++++++++++++++++-\n     gettext-tools/src/xgettext.c |  2 +-\n     2 files changed, 17 insertions(+), 2 deletions(-)\n\n    diff --git a/gettext-tools/src/x-c.c b/gettext-tools/src/x-c.c\n    index 1844a5df7..51dd0a9bc 100644\n    --- a/gettext-tools/src/x-c.c\n    +++ b/gettext-tools/src/x-c.c\n    @@ -1802,6 +1802,12 @@ phase6_unget (token_ty *tp)\n     static bool\n     is_inttypes_macro (const char *name)\n     {\n    +  /* PRItime is a maro for timestamp_t in git.git. */\n    +  if (!strncmp(name, \"PRItime\", 7))\n    +    {\n    +      return true;\n    +    }\n    +\n       /* Syntax:\n          P R I { d | i | o | u | x | X }\n          { { | LEAST | FAST } { 8 | 16 | 32 | 64 } | MAX | PTR }  */\n    @@ -1843,8 +1849,17 @@ phase8a_get (token_ty *tp)\n       phase6_get (tp);\n       if (tp->type == token_type_name && is_inttypes_macro (tp->string))\n         {\n    +      char *new_string;\n           /* Turn PRIdXXX into \"<PRIdXXX>\".  */\n    -      char *new_string = xasprintf (\"<%s>\", tp->string);\n    +      if (!strncmp(tp->string, \"PRItime\", 7))\n    +        {\n    +          /* Replace PRItime with PRIuMAX for git.git project */\n    +          new_string = xasprintf (\"<%s>\", \"PRIuMAX\");\n    +        }\n    +      else\n    +        {\n    +          new_string = xasprintf (\"<%s>\", tp->string);\n    +        }\n           free (tp->string);\n           tp->string = new_string;\n           tp->comment = add_reference (savable_comment);\n    diff --git a/gettext-tools/src/xgettext.c b/gettext-tools/src/xgettext.c\n    index f848d76d1..0350a1bee 100644\n    --- a/gettext-tools/src/xgettext.c\n    +++ b/gettext-tools/src/xgettext.c\n    @@ -676,7 +676,7 @@ main (int argc, char *argv[])\n       /* Version information requested.  */\n       if (do_version)\n         {\n    -      printf (\"%s (GNU %s) %s\\n\", basename (program_name),\nPACKAGE, VERSION);\n    +      printf (\"%s (GNU %s) %s (PRItime to PRIuMAX for\ngit.git)\\n\", basename (program_name), PACKAGE, VERSION);\n           /* xgettext: no-wrap */\n           printf (_(\"Copyright (C) %s Free Software Foundation, Inc.\\n\\\n     License GPLv3+: GNU GPL version 3 or later\n<http://gnu.org/licenses/gpl.html>\\n\\\n    --\n    2.14.0.rc0.1.g3ccfa2fb49\n-- \n蒋鑫\n\n华为技术有限公司\n邮件: xin.jiang@huawei.com, worldhello.net@gmail.com\n博客: http://www.worldhello.net/\n微博: http://weibo.com/gotgit/\n电话: 18601196889\n"},{"id":"324889","messageId":"xmqqr2x9fjpi.fsf@gitster.mtv.corp.google.com","threadId":"46389","inReplyTo":"CANYiYbF+XDANNbpZJ-jL7y81QhggW_snBuWeONSCUc4CPn2zMw@mail.gmail.com","subject":"Re: [PATCH] PRItime: wrap PRItime for better l10n compatibility","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-07-21T23:34:17Z","receivedAt":"2017-07-21T23:34:31Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jiang Xin <worldhello.net@gmail.com> writes:\n\n> A very small hack on gettext.  When extract l10n messages to pot file\n> with `xgettext`, will grep \"PRItime\", and do \"sed s/PRItime/PRIuMAX\"\n> inside `xgettext`.\n>\n> See this patch:\n> https://github.com/jiangxin/gettext/commit/b0a726431c93b5a1ca0fe749de376b0752e75fb0\n> ...\n>      gettext-tools/src/x-c.c      | 17 ++++++++++++++++-\n>      gettext-tools/src/xgettext.c |  2 +-\n>      2 files changed, 17 insertions(+), 2 deletions(-)\n\nI do not think the size of the \"hack\" is much of an issue.  There is\nno way you can sell this patch to the upstream, which would mean\nthat we would have to be relying on our own private edition of the\nexternal tool, and that is what I feel very uncomfortable about.\n\nYou are not passing %<PRItime> through the toolchain and instead\nturning it into %<PRIuMAX>, which is less risky than the obvious\nalternative, but when we switch to a signed timestamp_t type and\nneed to change it something else (e.g.  PRIdMAX), you'd need to make\nsure you update that private edition that matches the source being\ncompiled.  You might even be asked to do the po/git.pot thing for\nboth 'maint' and 'master' at the same time, when the former still\nuses unsigned timestamp_t while the latter switched to signed one,\nwhich would mean you'd need two hacked versions of gettext handy and\nchoose the \"right\" one.\n\nCompared to that, Dscho's \"hack\" at least ties what PRItime is\nreplaced with and what the source code says by being in the\nMakefile, which is tracked alongside the rest of the source.  So I\nsomehow feel that the approach has smaller chance of going wrong.\n\nAm I missing some concerns you had that you think the tweaked\ngettext would solve better?\n"},{"id":"324890","messageId":"CANYiYbGkuGNNYn4OF5w=1+Pqn9hEHWcD+DYVB6AXRs0vFEsY2Q@mail.gmail.com","threadId":"46389","inReplyTo":"xmqqr2x9fjpi.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH] PRItime: wrap PRItime for better l10n compatibility","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2017-07-22T00:43:18Z","receivedAt":"2017-07-22T00:43:25Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"2017-07-22 7:34 GMT+08:00 Junio C Hamano <gitster@pobox.com>:\n> Jiang Xin <worldhello.net@gmail.com> writes:\n>\n>> A very small hack on gettext.  When extract l10n messages to pot file\n>> with `xgettext`, will grep \"PRItime\", and do \"sed s/PRItime/PRIuMAX\"\n>> inside `xgettext`.\n>>\n>> See this patch:\n>> https://github.com/jiangxin/gettext/commit/b0a726431c93b5a1ca0fe749de376b0752e75fb0\n>> ...\n>>      gettext-tools/src/x-c.c      | 17 ++++++++++++++++-\n>>      gettext-tools/src/xgettext.c |  2 +-\n>>      2 files changed, 17 insertions(+), 2 deletions(-)\n>\n> I do not think the size of the \"hack\" is much of an issue.  There is\n> no way you can sell this patch to the upstream, which would mean\n> that we would have to be relying on our own private edition of the\n> external tool, and that is what I feel very uncomfortable about.\n\nI never think about that, and I won't sell it to the upstream. ;)\n\n> You are not passing %<PRItime> through the toolchain and instead\n> turning it into %<PRIuMAX>, which is less risky than the obvious\n> alternative, but when we switch to a signed timestamp_t type and\n> need to change it something else (e.g.  PRIdMAX), you'd need to make\n> sure you update that private edition that matches the source being\n> compiled.\n\nThat's why I grep \"PRItime to PRIuMAX\" from `xgettext --version`.\nWhen we need something else, we can tweak the \"check-xgettext\" task\nagain in Makefile, to match with a grep-\"PRItime to PRIdMAX\" version\nof `xgettext`.\n\n>  You might even be asked to do the po/git.pot thing for\n> both 'maint' and 'master' at the same time, when the former still\n> uses unsigned timestamp_t while the latter switched to signed one,\n> which would mean you'd need two hacked versions of gettext handy and\n> choose the \"right\" one.\n\nBut it is rare to maintain po/git.pot file for 'maint' branch.  And if\nI need, I will switch to a different version of gettext.  Makefile\nwill throw a error message, if I use a wrong version of gettext.\n\n> Compared to that, Dscho's \"hack\" at least ties what PRItime is\n> replaced with and what the source code says by being in the\n> Makefile, which is tracked alongside the rest of the source.  So I\n> somehow feel that the approach has smaller chance of going wrong.\n\nBenefit of using the tweak version of gettext:\n\n1. `make pot` can be run in a tar extract directory (without git controlled).\n2. do not need to run `git reset --hard`.\n3.  it's quick (nobody cares).\n\n-- \nJiang Xin\n"},{"id":"324891","messageId":"a87e7252bf9de8a87e5dc7712946f72459778d6c.1500684532.git.worldhello.net@gmail.com","threadId":"46389","inReplyTo":"CANYiYbGkuGNNYn4OF5w=1+Pqn9hEHWcD+DYVB6AXRs0vFEsY2Q@mail.gmail.com","subject":"[PATCH] Makefile: generate pot file using a tweaked version of xgettext","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2017-07-22T00:52:38Z","receivedAt":"2017-07-22T00:52:55Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"Instead of doing a sed (s|PRItime|PRIuMAX) in working tree directly, we\ncan use a tweaked version of gettext, which can replace PRItime macro to\nPRIuMAX (version 1.x) in runtime.  We do not need to reset our working\ntree anymore, and this operation can be run without a version controlled\nworking tree.\n\nThe tweaked version of gettext is hosted at:\n\n    https://github.com/jiangxin/gettext\n\nSigned-off-by: Jiang Xin <worldhello.net@gmail.com>\n---\n Makefile | 29 ++++++++++-------------------\n 1 file changed, 10 insertions(+), 19 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 461c845d33..782c519133 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2221,33 +2221,23 @@ LOCALIZED_SH += t/t0200/test.sh\n LOCALIZED_PERL += t/t0200/test.perl\n endif\n \n-## Note that this is meant to be run only by the localization coordinator\n-## under a very controlled condition, i.e. (1) it is to be run in a\n-## Git repository (not a tarball extract), (2) any local modifications\n-## will be lost.\n ## Gettext tools cannot work with our own custom PRItime type, so\n-## we replace PRItime with PRIuMAX.  We need to update this to\n-## PRIdMAX if we switch to a signed type later.\n+## we use a hacked version of xgettext to replace PRItime with PRIuMAX.\n+## We need to update this to PRIdMAX if we switch to a signed type later.\n \n-po/git.pot: $(GENERATED_H) FORCE\n-\t# All modifications will be reverted at the end, so we do not\n-\t# want to have any local change.\n-\tgit diff --quiet HEAD && git diff --quiet --cached\n-\n-\t@for s in $(LOCALIZED_C) $(LOCALIZED_SH) $(LOCALIZED_PERL); \\\n-\tdo \\\n-\t\tsed -e 's|PRItime|PRIuMAX|g' <\"$$s\" >\"$$s+\" && \\\n-\t\tcat \"$$s+\" >\"$$s\" && rm \"$$s+\"; \\\n-\tdone\n+check-xgettext:\n+\t@if ! $(XGETTEXT) --version | grep -q \"PRItime tweak v1\"; then \\\n+\t\techo >&2 \"Error: must use a hacked version of xgettext, which can convert PRItime macro as we need.\"; \\\n+\t\techo >&2 \"Error: download it from https://github.com/jiangxin/gettext\"; \\\n+\t\texit 1; \\\n+\tfi\n \n+po/git.pot: check-xgettext $(GENERATED_H) FORCE\n \t$(QUIET_XGETTEXT)$(XGETTEXT) -o$@+ $(XGETTEXT_FLAGS_C) $(LOCALIZED_C)\n \t$(QUIET_XGETTEXT)$(XGETTEXT) -o$@+ --join-existing $(XGETTEXT_FLAGS_SH) \\\n \t\t$(LOCALIZED_SH)\n \t$(QUIET_XGETTEXT)$(XGETTEXT) -o$@+ --join-existing $(XGETTEXT_FLAGS_PERL) \\\n \t\t$(LOCALIZED_PERL)\n-\n-\t# Reverting the munged source, leaving only the updated $@\n-\tgit reset --hard\n \tmv $@+ $@\n \n .PHONY: pot\n@@ -2737,6 +2727,7 @@ check-builtins::\n .PHONY: coverage coverage-clean coverage-compile coverage-test coverage-report\n .PHONY: coverage-untested-functions cover_db cover_db_html\n .PHONY: coverage-clean-results\n+.PHONY: check-xgettext\n \n coverage:\n \t$(MAKE) coverage-test\n-- \n2.14.0.rc0.1.g3ccfa2fb49\n\n"},{"id":"324892","messageId":"xmqqmv7xfavz.fsf@gitster.mtv.corp.google.com","threadId":"46389","inReplyTo":"CANYiYbGkuGNNYn4OF5w=1+Pqn9hEHWcD+DYVB6AXRs0vFEsY2Q@mail.gmail.com","subject":"Re: [PATCH] PRItime: wrap PRItime for better l10n compatibility","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-07-22T02:44:48Z","receivedAt":"2017-07-22T02:45:02Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jiang Xin <worldhello.net@gmail.com> writes:\n\n> But it is rare to maintain po/git.pot file for 'maint' branch.  And if\n> I need, I will switch to a different version of gettext.  Makefile\n> will throw a error message, if I use a wrong version of gettext.\n\nIs that the \"v1\" in the check in your Makefile patch is about?  That\nis, when we need to change the underlying type, your updated gettext\nwould say something different from \"v1\" and you will have Makefile\nupdate to expect that new version?  Then it would be workable, I'd\nguess.\n\n>> Compared to that, Dscho's \"hack\" at least ties what PRItime is\n>> replaced with and what the source code says by being in the\n>> Makefile, which is tracked alongside the rest of the source.  So I\n>> somehow feel that the approach has smaller chance of going wrong.\n>\n> Benefit of using the tweak version of gettext:\n>\n> 1. `make pot` can be run in a tar extract directory (without git controlled).\n> 2. do not need to run `git reset --hard`.\n> 3.  it's quick (nobody cares).\n\nThis is about a tool and workflow only you (and your successor, when\nthe time comes) need to use, so ultimately I'd prefer to leave it up\nto you, but I'd want to make sure you are making your decision with\nsound rationale.  I personally do not think 1. and 2. above are real\nissues in practice, because (1) you'd be committing the result of\n\"make pot\" so that translators can work off of it---which at least\nto me means that being able to run on a tarball extract is not a\nuseful feature, and (2) when you are about to run xgettext to\nextract strings from the message, you do not want to have local\nmodifications, extracting potentially modified strings with\npotentially offset line numbers in the resulting pot file, so\nhaving to run \"git reset --hard\" at the end is not a problem.\n\nI do not know if 3. is a practical issue or not (I did try \"make\npot\" with the tip of 'master' tonight myself, and I didn't find it\nmuch slower than the unmodified one).\n\nHaving said all that, again, I'd prefer to leave this up to you, so\nunless I hear that you changed your mind, the tip of 'master' I'll\ntag, probably sometime tomorrow my time, will have your patch to the\nMakefile to rely on your private edition of xgettext.\n\nThanks.\n"},{"id":"324896","messageId":"alpine.DEB.2.21.1.1707221320350.4271@virtualbox","threadId":"46389","inReplyTo":"xmqq7ez1j0wv.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH] PRItime: wrap PRItime for better l10n compatibility","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2017-07-22T11:21:41Z","receivedAt":"2017-07-22T11:22:07Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Fri, 21 Jul 2017, Junio C Hamano wrote:\n\n> Jean-Noël Avila <jn.avila@free.fr> writes:\n> \n> > Le 20/07/2017 à 20:57, Junio C Hamano a écrit :\n> >>\n> >> +\tgit diff --quiet HEAD && git diff --quiet --cached\n> >> +\n> >> +\t@for s in $(LOCALIZED_C) $(LOCALIZED_SH) $(LOCALIZED_PERL); \\\n> >\n> > Does PRIuMAX make sense for perl and sh files?\n> \n> Not really; I did this primarily because I would prefer to keep\n> things consistent, anticipating there may be some other things we\n> need to replace before running gettext(1) for other reasons later.\n\nIt would add unnecessary churn, too, to add those specific exclusions and\nmake things inconsistent: the use of PRItime in Perl or shell scripts\nwould already make those scripts barf. And if it is unnecessary churn...\nlet's not do it?\n\nCiao,\nDscho"},{"id":"324897","messageId":"alpine.DEB.2.21.1.1707221323420.4271@virtualbox","threadId":"46389","inReplyTo":"CANYiYbGkuGNNYn4OF5w=1+Pqn9hEHWcD+DYVB6AXRs0vFEsY2Q@mail.gmail.com","subject":"Re: [PATCH] PRItime: wrap PRItime for better l10n compatibility","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2017-07-22T11:28:52Z","receivedAt":"2017-07-22T11:29:03Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sat, 22 Jul 2017, Jiang Xin wrote:\n\n> 2017-07-22 7:34 GMT+08:00 Junio C Hamano <gitster@pobox.com>:\n> > Jiang Xin <worldhello.net@gmail.com> writes:\n> >\n> >> A very small hack on gettext.\n\nI am 100% opposed to this hack. It is already cumbersome enough to find\nout what is involved in i18n (it took *me* five minutes to find out that\nmuch of the information is in po/README, with a lot of information stored\n*on an external site*, and I still managed to miss the `make pot` target).\n\nIf at all, we need to make things easier instead of harder.\n\nRequiring potential volunteers to waste their time to compile an\nunnecessary fork of gettext? Not so great an idea.\n\nPlus, each and every Git build would now have to compile their own\ngettext, too, as the vanilla one would not handle the .po files containing\n%<PRItime>!!!\n\nAnd that requirement would impact instantaneously people like me, and even\nworse: some other packagers might be unaware of the new requirement which\nwould not be caught during the build, and neither by the test suite.\nDouble bad idea.\n\nSo let's go with Junio's patch.\n\nCiao,\nDscho\n"},{"id":"324899","messageId":"xmqqeft8fp5j.fsf@gitster.mtv.corp.google.com","threadId":"46389","inReplyTo":"alpine.DEB.2.21.1.1707221323420.4271@virtualbox","subject":"Re: [PATCH] PRItime: wrap PRItime for better l10n compatibility","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-07-22T15:48:56Z","receivedAt":"2017-07-22T15:49:04Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n>> >> A very small hack on gettext.\n>\n> I am 100% opposed to this hack. It is already cumbersome enough to find\n> out what is involved in i18n (it took *me* five minutes to find out that\n> much of the information is in po/README, with a lot of information stored\n> *on an external site*, and I still managed to miss the `make pot` target).\n>\n> If at all, we need to make things easier instead of harder.\n>\n> Requiring potential volunteers to waste their time to compile an\n> unnecessary fork of gettext? Not so great an idea.\n>\n> Plus, each and every Git build would now have to compile their own\n> gettext, too, as the vanilla one would not handle the .po files containing\n> %<PRItime>!!!\n>\n> And that requirement would impact instantaneously people like me, and even\n> worse: some other packagers might be unaware of the new requirement which\n> would not be caught during the build, and neither by the test suite.\n> Double bad idea.\n\nIf I understand correctly, the patch hacks the input processing of\nxgettext (which reads our source code and generates po/git.pot) so\nthat when it sees PRItime, pretend that it saw PRIuMAX, causing it\nto output %<PRIuMAX> in its output.\n\nIn our workflow, \n\n    * The po/git.pot file is updated only by the l10n coordinator,\n      and then the result is committed to our tree.\n\n    * Translators build on that commit by (1) running msgmerge which\n      takes po/git.pot and wiggles its entries into their existing\n      po/$lang.po file so that po/$lang.po file has new entries from\n      po/git.pot and (2) editing po/$lang.po file.  The result is\n      committed to our tree.\n\n    * The build procedure builders use runs the resulting\n      po/$lang.po files through msgfmt to produce po/$lang.mo files,\n      which will be installed.\n\nAs long as the first step results in %<PRIuMAX> (not %<PRItime> or\nanything that plain vanilla msgmerge and msgfmt do not understand),\nthe second step and third step do not require any hacked version of\ngettext tools.\n\nEven though I tend to agree with your conclusion that pre-processing\nour source before passing it to xgettext is probably a better\nsolution in the longer term, I think the most of the objections in\nyour message come from your misunderstanding of what Jiang's patch\ndoes and are not based on facts.  My understanding is that\ntranslators do not need to compile a custom msgmerge and builders do\nnot need a custom msgfmt.\n\n"},{"id":"324900","messageId":"xmqqa83wfoxj.fsf@gitster.mtv.corp.google.com","threadId":"46389","inReplyTo":"alpine.DEB.2.21.1.1707221320350.4271@virtualbox","subject":"Re: [PATCH] PRItime: wrap PRItime for better l10n compatibility","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-07-22T15:53:44Z","receivedAt":"2017-07-22T15:53:57Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> On Fri, 21 Jul 2017, Junio C Hamano wrote:\n>\n>> Jean-Noël Avila <jn.avila@free.fr> writes:\n>> \n>> > Le 20/07/2017 à 20:57, Junio C Hamano a écrit :\n>> >>\n>> >> +\tgit diff --quiet HEAD && git diff --quiet --cached\n>> >> +\n>> >> +\t@for s in $(LOCALIZED_C) $(LOCALIZED_SH) $(LOCALIZED_PERL); \\\n>> >\n>> > Does PRIuMAX make sense for perl and sh files?\n>> \n>> Not really; I did this primarily because I would prefer to keep\n>> things consistent, anticipating there may be some other things we\n>> need to replace before running gettext(1) for other reasons later.\n>\n> It would add unnecessary churn, too, to add those specific exclusions and\n> make things inconsistent: the use of PRItime in Perl or shell scripts\n> would already make those scripts barf. And if it is unnecessary churn...\n> let's not do it?\n\nSorry, but I cannot quite tell if you are in favor of limiting the\nset of source files that go through the sed substitution (because we\nknow PRIuMAX is just as nonsensical as PRItime in perl and shell\nsource), or if you are in favor of keeping the patch as-is (because\nchanging the set of source files is a churn and substitutions would\nnot hurt)?\n\nI am actually OK to change the above loop to process only the C\nsources; I am not OK to change it to process only date.c which\nhappens to be the only source that has PRItime that matters in this\ncontext, of course.\n\nThanks.\n\n\n"},{"id":"324903","messageId":"1500742926.2744.4.camel@gmail.com","threadId":"46389","inReplyTo":"249ac6f8-af3c-4b20-5bf0-87a82866cc7a@free.fr","subject":"Re: [L10N] Kickoff of translation for Git 2.14.0 round 1","fromName":"Kaartic Sivaraam","fromEmail":"kaarticsivaraam91196@gmail.com","sentAt":"2017-07-22T17:02:06Z","receivedAt":"2017-07-22T17:02:00Z","isPatch":false,"sender":{"key":"kaartic.sivaraam@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12448084?v=4"},"body":"On Sat, 2017-07-15 at 21:30 +0200, Jean-Noël Avila wrote:\n>  * commit 4ddb1354e8 (\"status: contextually notify user about an initial\n> commit\") plays sentence lego while introducing colorization which again\n> does not play well with i18n.\n> \nWhat, if anything, should be done about this?\n\n-- \nKaartic\n"},{"id":"324905","messageId":"70aeede1-6052-94fb-71a5-ff2f5717098a@free.fr","threadId":"46389","inReplyTo":"1500742926.2744.4.camel@gmail.com","subject":"Re: [L10N] Kickoff of translation for Git 2.14.0 round 1","fromName":"Jean-Noël Avila","fromEmail":"jn.avila@free.fr","sentAt":"2017-07-23T02:43:14Z","receivedAt":"2017-07-23T02:44:10Z","isPatch":false,"sender":{"key":"jn.avila@free.fr","avatar":"https://avatars.githubusercontent.com/u/156172?v=4"},"body":"Le 22/07/2017 à 19:02, Kaartic Sivaraam a écrit :\n> On Sat, 2017-07-15 at 21:30 +0200, Jean-Noël Avila wrote:\n>>  * commit 4ddb1354e8 (\"status: contextually notify user about an initial\n>> commit\") plays sentence lego while introducing colorization which again\n>> does not play well with i18n.\n>>\n> What, if anything, should be done about this?\n>\n\nI only spotted it because the string is new for translation. But the\nprevious version was already playing sentence lego. So this is not a\nregression ;-)\n\n\nIf I understand correctly, getting a i18n friendly string would require\nbeing able to \"color_sprintf\" the branche name, and then \"color_fprintf\"\nthe output with a %s formatting string. None of this is already\navailable and that would introduce cumbersome logic in the code.\n\n\nMore generally, i18n puts some pressure on coding style for sure, and it\ngets worse with multi-platform and coloring... how can we ease the\nburden of developpers on this front without resorting to ad hoc patches?\n\n"},{"id":"324906","messageId":"2421d5f3-12ee-833b-72d8-de627fbfe26c@scantech.fr","threadId":"46389","inReplyTo":"CANYiYbGkuGNNYn4OF5w=1+Pqn9hEHWcD+DYVB6AXRs0vFEsY2Q@mail.gmail.com","subject":"Re: [PATCH] PRItime: wrap PRItime for better l10n compatibility","fromName":"Jean-Noël AVILA","fromEmail":"jean-noel.avila@scantech.fr","sentAt":"2017-07-23T02:33:18Z","receivedAt":"2017-07-23T03:51:48Z","isPatch":true,"sender":{"key":"jean-noel.avila@scantech.fr","avatar":null},"body":"Le 22/07/2017 à 02:43, Jiang Xin a écrit :\n>\n> Benefit of using the tweak version of gettext:\n>\n> 1. `make pot` can be run in a tar extract directory (without git controlled).\n\nThis issue is real for packet maintainers who can patch the original\nsource and run their own set of utilities outside of a git repo. This\ncan be possible with Junio's proposition by writing the files to a\ntemporary directory before running the xgettext, then removing the\ntemporary directory.\n\nPlease note that with respect to this issue, the patched xgettext\napproach is completely disruptive.\n\n> 2. do not need to run `git reset --hard`.\n\nSame as before.\n\n> 3.  it's quick (nobody cares).\n>\n\nRequiring patched tools is really breaking collaboration. Git made a\ngreat case of relying on standard tools (not even GNU versions), so that\nwould really go backward.\n\n\nPlus, I hope that some day, instead of translators finding afterwards\nthat a change broke i18n capabilities, developpers would have some kind\nof sanity check. Requiring special versions of i18n tooling stops this hope.\n\n\n\nbegin:vcard\nfn;quoted-printable:Jean-No=C3=ABl AVILA\nn;quoted-printable:AVILA;Jean-No=C3=ABl\norg:SCANTECH FRANCE\nadr;quoted-printable:Savoie Technolac, BP244;;34, All=C3=A9e du Lac d'Aiguebelette;Le Bourget du Lac;;73374;FRANCE\nemail;internet:jean-noel.avila@scantech.fr\ntitle:Embedded Systems Manager\ntel;work:+33 479265450\ntel;cell:+33 633046418\nx-mozilla-html:FALSE\nurl:http://www.scantech.fr\nversion:2.1\nend:vcard\n\n"},{"id":"324921","messageId":"xmqqwp6yes44.fsf@gitster.mtv.corp.google.com","threadId":"46389","inReplyTo":"2421d5f3-12ee-833b-72d8-de627fbfe26c@scantech.fr","subject":"Re: [PATCH] PRItime: wrap PRItime for better l10n compatibility","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-07-23T21:54:51Z","receivedAt":"2017-07-23T21:55:08Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jean-Noël AVILA <jean-noel.avila@scantech.fr> writes:\n\n> Le 22/07/2017 à 02:43, Jiang Xin a écrit :\n>>\n>> Benefit of using the tweak version of gettext:\n>>\n>> 1. `make pot` can be run in a tar extract directory (without git controlled).\n>\n> This issue is real for packet maintainers who can patch the original\n> source and run their own set of utilities outside of a git repo. This\n> can be possible with Junio's proposition by writing the files to a\n> temporary directory before running the xgettext, then removing the\n> temporary directory.\n>\n> Please note that with respect to this issue, the patched xgettext\n> approach is completely disruptive.\n\nOK, so what you are saying is that my assumption that Jiang (at\nleast for now, and his successor l10n coordinator in sometime in the\nfuture) would be the only one who needs to have access to the\nmachinery to update po/git.pot and that it does not matter that much\nwhat that exact machinery is as long as the resulting po/git.pot\nlists messages with %<PRIuMAX> and other known ones because plain\nvanilla tools will grok such po/git.pot file just fine, were both\ntoo optimistic.\n\nI think binary packagers, who update the software with their own\nchanges, produce their own modified po/git.pot and have that\ntranslated into multiple languages, are capable of coping with any\nmethod we use ourselves, but being capable of doing something and\nbeing happy to do that thing are two different things, and we need\nto aim for the latter---we should not make things unnecessarily\ncumbersome for them.\n\nSo I'll leave the s/PRItime/PRIuMAX/ patch in the 'master' without\nJiang's change for 2.14-rc1.  The approach to require private\nedition of xgettext, while it may technically be a fun exercise,\nwould not fly very well in the real world.\n\nFor those who want to work with a tarball extract without being in a\nGit repository, it would be sufficient fot them to run \"git init &&\ngit commit --allow-empty -m import\" immediately after extracting the\ntarball, even if we require that \"make pot\" must be run in a clean\nrepository.  And I'd prefer to go that route than copying into a\ntemporary directory, primarily because I do not want to having to\nworry about what to copy---when we know we pass $foo.c through\nxgettext, we know we want to put the modified copy of $foo.c in the\ntemporary, but I do not want to even think if we need to also copy\nthe header files $foo.c \"#include\"s, for example.\n\nThanks.\n"},{"id":"324928","messageId":"CANYiYbHMMJ1tubajHNZVsQ=ihmogtF4=FqrRWvPJg4+wuBapbg@mail.gmail.com","threadId":"46389","inReplyTo":"alpine.DEB.2.21.1.1707221323420.4271@virtualbox","subject":"Re: [PATCH] PRItime: wrap PRItime for better l10n compatibility","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2017-07-24T01:38:17Z","receivedAt":"2017-07-24T01:38:25Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"2017-07-22 19:28 GMT+08:00 Johannes Schindelin <Johannes.Schindelin@gmx.de>:\n> Hi,\n>\n> On Sat, 22 Jul 2017, Jiang Xin wrote:\n>\n>> 2017-07-22 7:34 GMT+08:00 Junio C Hamano <gitster@pobox.com>:\n>> > Jiang Xin <worldhello.net@gmail.com> writes:\n>> >\n>> >> A very small hack on gettext.\n>\n> I am 100% opposed to this hack.\n\nIt's really very small, see:\n\n*  https://github.com/jiangxin/gettext/commit/b0a72643\n*  https://public-inbox.org/git/a87e7252bf9de8a87e5dc7712946f72459778d6c.1500684532.git.worldhello.net@gmail.com/\n\n> It is already cumbersome enough to find\n> out what is involved in i18n (it took *me* five minutes to find out that\n> much of the information is in po/README, with a lot of information stored\n> *on an external site*, and I still managed to miss the `make pot` target).\n>\n> If at all, we need to make things easier instead of harder.\n\nIf it is only the l10n coordinate's duty to generate po/git.pot, the\ntweak is OK.  But if other guys need to recreate po/git.pot, it's\nhard, especially for guys working on Mac or Windows.\n\n>\n> Requiring potential volunteers to waste their time to compile an\n> unnecessary fork of gettext? Not so great an idea.\n>\n> Plus, each and every Git build would now have to compile their own\n> gettext, too, as the vanilla one would not handle the .po files containing\n> %<PRItime>!!!\n\nNo, only l10n coordinator and potential po/git.pot generator are involved.\n\n>\n> So let's go with Junio's patch.\n\nI agree.  We just go with the sed-then-cleanup version until we meet\nambiguities (I mean some words other than PRItime need to be\nreplaced).\n\n-- \nJiang Xin\n"},{"id":"324929","messageId":"CANYiYbG_gh82M5ccZA-DnVFr0XrCzDJYd=Q0KrDfQXGZ=2z9kw@mail.gmail.com","threadId":"46389","inReplyTo":"xmqqeft8fp5j.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH] PRItime: wrap PRItime for better l10n compatibility","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2017-07-24T01:50:17Z","receivedAt":"2017-07-24T01:50:23Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"2017-07-22 23:48 GMT+08:00 Junio C Hamano <gitster@pobox.com>:\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n>\n>>> >> A very small hack on gettext.\n>>\n>> I am 100% opposed to this hack. It is already cumbersome enough to find\n>> out what is involved in i18n (it took *me* five minutes to find out that\n>> much of the information is in po/README, with a lot of information stored\n>> *on an external site*, and I still managed to miss the `make pot` target).\n>>\n>> If at all, we need to make things easier instead of harder.\n>>\n>> Requiring potential volunteers to waste their time to compile an\n>> unnecessary fork of gettext? Not so great an idea.\n>>\n>> Plus, each and every Git build would now have to compile their own\n>> gettext, too, as the vanilla one would not handle the .po files containing\n>> %<PRItime>!!!\n>>\n>> And that requirement would impact instantaneously people like me, and even\n>> worse: some other packagers might be unaware of the new requirement which\n>> would not be caught during the build, and neither by the test suite.\n>> Double bad idea.\n>\n> If I understand correctly, the patch hacks the input processing of\n> xgettext (which reads our source code and generates po/git.pot) so\n> that when it sees PRItime, pretend that it saw PRIuMAX, causing it\n> to output %<PRIuMAX> in its output.\n>\n> In our workflow,\n>\n>     * The po/git.pot file is updated only by the l10n coordinator,\n>       and then the result is committed to our tree.\n>\n>     * Translators build on that commit by (1) running msgmerge which\n>       takes po/git.pot and wiggles its entries into their existing\n>       po/$lang.po file so that po/$lang.po file has new entries from\n>       po/git.pot and (2) editing po/$lang.po file.  The result is\n>       committed to our tree.\n>\n>     * The build procedure builders use runs the resulting\n>       po/$lang.po files through msgfmt to produce po/$lang.mo files,\n>       which will be installed.\n>\n> As long as the first step results in %<PRIuMAX> (not %<PRItime> or\n> anything that plain vanilla msgmerge and msgfmt do not understand),\n> the second step and third step do not require any hacked version of\n> gettext tools.\n>\n> Even though I tend to agree with your conclusion that pre-processing\n> our source before passing it to xgettext is probably a better\n> solution in the longer term, I think the most of the objections in\n> your message come from your misunderstanding of what Jiang's patch\n> does and are not based on facts.  My understanding is that\n> translators do not need to compile a custom msgmerge and builders do\n> not need a custom msgfmt.\n>\n\nI appreciate Junio's explanation. I totally agree.\n\n-- \nJiang Xin\n"},{"id":"324931","messageId":"CANYiYbHi2tbRj159LgLpNRb7esMwZWOjetShF2n51rBavGYsGQ@mail.gmail.com","threadId":"46389","inReplyTo":"2421d5f3-12ee-833b-72d8-de627fbfe26c@scantech.fr","subject":"Re: [PATCH] PRItime: wrap PRItime for better l10n compatibility","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2017-07-24T02:02:53Z","receivedAt":"2017-07-24T02:02:58Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"2017-07-23 10:33 GMT+08:00 Jean-Noël AVILA <jean-noel.avila@scantech.fr>:\n> Plus, I hope that some day, instead of translators finding afterwards\n> that a change broke i18n capabilities, developpers would have some kind\n> of sanity check. Requiring special versions of i18n tooling stops this hope.\n>\n\nIt would be fun to create some tools to help l10n guys finding l10n\nchanges on every git commit.\n\n\n-- \nJiang Xin\n"},{"id":"324971","messageId":"xmqqd18pejop.fsf@gitster.mtv.corp.google.com","threadId":"46389","inReplyTo":"CANYiYbHMMJ1tubajHNZVsQ=ihmogtF4=FqrRWvPJg4+wuBapbg@mail.gmail.com","subject":"Re: [PATCH] PRItime: wrap PRItime for better l10n compatibility","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-07-24T19:09:10Z","receivedAt":"2017-07-24T19:11:21Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jiang Xin <worldhello.net@gmail.com> writes:\n\n>> So let's go with Junio's patch.\n>\n> I agree.  We just go with the sed-then-cleanup version until we meet\n> ambiguities (I mean some words other than PRItime need to be\n> replaced).\n\nOK, thanks for all involved to get us to a conclusion.  Jiang, I saw\nyou already made an announcement for the second round.  Thank you\nvery much for doing so without waiting me---I was stuck on something\nelse and my morning was blown X-<.  I'll still try to tag -rc1 by\nthe end of business today.\n\n"},{"id":"324972","messageId":"xmqq8tjdejna.fsf@gitster.mtv.corp.google.com","threadId":"46389","inReplyTo":"CANYiYbHi2tbRj159LgLpNRb7esMwZWOjetShF2n51rBavGYsGQ@mail.gmail.com","subject":"Re: [PATCH] PRItime: wrap PRItime for better l10n compatibility","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-07-24T19:10:01Z","receivedAt":"2017-07-24T19:14:23Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jiang Xin <worldhello.net@gmail.com> writes:\n\n> 2017-07-23 10:33 GMT+08:00 Jean-Noël AVILA <jean-noel.avila@scantech.fr>:\n>> Plus, I hope that some day, instead of translators finding afterwards\n>> that a change broke i18n capabilities, developpers would have some kind\n>> of sanity check. Requiring special versions of i18n tooling stops this hope.\n>\n> It would be fun to create some tools to help l10n guys finding l10n\n> changes on every git commit.\n\nIt is not just fun but would be useful, I would think.\n"},{"id":"325031","messageId":"alpine.DEB.2.21.1.1707251219480.4271@virtualbox","threadId":"46389","inReplyTo":"xmqqa83wfoxj.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH] PRItime: wrap PRItime for better l10n compatibility","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2017-07-25T10:20:47Z","receivedAt":"2017-07-25T10:20:57Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Junio,\n\nOn Sat, 22 Jul 2017, Junio C Hamano wrote:\n\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> \n> > On Fri, 21 Jul 2017, Junio C Hamano wrote:\n> >\n> >> Jean-Noël Avila <jn.avila@free.fr> writes:\n> >> \n> >> > Le 20/07/2017 à 20:57, Junio C Hamano a écrit :\n> >> >>\n> >> >> +\tgit diff --quiet HEAD && git diff --quiet --cached\n> >> >> +\n> >> >> +\t@for s in $(LOCALIZED_C) $(LOCALIZED_SH) $(LOCALIZED_PERL); \\\n> >> >\n> >> > Does PRIuMAX make sense for perl and sh files?\n> >> \n> >> Not really; I did this primarily because I would prefer to keep\n> >> things consistent, anticipating there may be some other things we\n> >> need to replace before running gettext(1) for other reasons later.\n> >\n> > It would add unnecessary churn, too, to add those specific exclusions and\n> > make things inconsistent: the use of PRItime in Perl or shell scripts\n> > would already make those scripts barf. And if it is unnecessary churn...\n> > let's not do it?\n> \n> Sorry, but I cannot quite tell if you are in favor of limiting the\n> set of source files that go through the sed substitution (because we\n> know PRIuMAX is just as nonsensical as PRItime in perl and shell\n> source), or if you are in favor of keeping the patch as-is (because\n> changing the set of source files is a churn and substitutions would\n> not hurt)?\n\nI was in favor of keeping the simplest strategy: simply cover all files,\nincluding Perl and Unix shell scripts. It would not bring any benefit to\nexclude them.\n\nCiao,\nDscho"},{"id":"325032","messageId":"alpine.DEB.2.21.1.1707251221160.4271@virtualbox","threadId":"46389","inReplyTo":"xmqqeft8fp5j.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH] PRItime: wrap PRItime for better l10n compatibility","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2017-07-25T10:22:12Z","receivedAt":"2017-07-25T10:22:27Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sat, 22 Jul 2017, Junio C Hamano wrote:\n\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> \n> >> >> A very small hack on gettext.\n> >\n> > I am 100% opposed to this hack. It is already cumbersome enough to find\n> > out what is involved in i18n (it took *me* five minutes to find out that\n> > much of the information is in po/README, with a lot of information stored\n> > *on an external site*, and I still managed to miss the `make pot` target).\n> >\n> > If at all, we need to make things easier instead of harder.\n> >\n> > Requiring potential volunteers to waste their time to compile an\n> > unnecessary fork of gettext? Not so great an idea.\n> >\n> > Plus, each and every Git build would now have to compile their own\n> > gettext, too, as the vanilla one would not handle the .po files containing\n> > %<PRItime>!!!\n> >\n> > And that requirement would impact instantaneously people like me, and even\n> > worse: some other packagers might be unaware of the new requirement which\n> > would not be caught during the build, and neither by the test suite.\n> > Double bad idea.\n> \n> If I understand correctly, the patch hacks the input processing of\n> xgettext (which reads our source code and generates po/git.pot) so\n> that when it sees PRItime, pretend that it saw PRIuMAX, causing it\n> to output %<PRIuMAX> in its output.\n\nOh, I missed that. That's even worse, as it precludes what you were\nwishing for: to replace timestamp_t by a signed data type eventually.\n\nCiao,\nDscho\n"},{"id":"325033","messageId":"alpine.DEB.2.21.1.1707251222550.4271@virtualbox","threadId":"46389","inReplyTo":"CANYiYbHMMJ1tubajHNZVsQ=ihmogtF4=FqrRWvPJg4+wuBapbg@mail.gmail.com","subject":"Re: [PATCH] PRItime: wrap PRItime for better l10n compatibility","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2017-07-25T10:25:54Z","receivedAt":"2017-07-25T10:26:04Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Mon, 24 Jul 2017, Jiang Xin wrote:\n\n> 2017-07-22 19:28 GMT+08:00 Johannes Schindelin <Johannes.Schindelin@gmx.de>:\n> >\n> > On Sat, 22 Jul 2017, Jiang Xin wrote:\n> >\n> >> 2017-07-22 7:34 GMT+08:00 Junio C Hamano <gitster@pobox.com>:\n> >> > Jiang Xin <worldhello.net@gmail.com> writes:\n> >> >\n> >> >> A very small hack on gettext.\n> >\n> > I am 100% opposed to this hack.\n> \n> It's really very small, see:\n> \n> *  https://github.com/jiangxin/gettext/commit/b0a72643\n\nI don't care about size. Insecure, pampered white men may be concerned\nabout size; not I.\n\nI am concerned about an *unnecessary* deviation from a well-established\nand well-maintained piece of software that would all of a sudden be\nversion-coupled with Git.\n\n> > If at all, we need to make things easier instead of harder.\n> \n> If it is only the l10n coordinate's duty to generate po/git.pot, the\n> tweak is OK.\n\nNo. You want to keep the bus number high.\n\n> I agree.  We just go with the sed-then-cleanup version until we meet\n> ambiguities (I mean some words other than PRItime need to be\n> replaced).\n\nEven then. Even then you should want to avoid version-coupling Git\nversions with gettext versions. Because that's precisely what you would\ndo, as gettext would now have to know about *this* Git version's\ninterpretation of certain data type names.\n\nCiao,\nDscho\n"},{"id":"325067","messageId":"xmqqfudkutw4.fsf@gitster.mtv.corp.google.com","threadId":"46389","inReplyTo":"alpine.DEB.2.21.1.1707251219480.4271@virtualbox","subject":"Re: [PATCH] PRItime: wrap PRItime for better l10n compatibility","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-07-25T20:46:35Z","receivedAt":"2017-07-25T20:46:50Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> Hi Junio,\n>\n> On Sat, 22 Jul 2017, Junio C Hamano wrote:\n>\n>> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n>> \n>> > On Fri, 21 Jul 2017, Junio C Hamano wrote:\n>> >\n>> >> Jean-Noël Avila <jn.avila@free.fr> writes:\n>> >> \n>> >> > Le 20/07/2017 à 20:57, Junio C Hamano a écrit :\n>> >> >>\n>> >> >> +\tgit diff --quiet HEAD && git diff --quiet --cached\n>> >> >> +\n>> >> >> +\t@for s in $(LOCALIZED_C) $(LOCALIZED_SH) $(LOCALIZED_PERL); \\\n>> >> >\n>> >> > Does PRIuMAX make sense for perl and sh files?\n>> >> \n>> >> Not really; I did this primarily because I would prefer to keep\n>> >> things consistent, anticipating there may be some other things we\n>> >> need to replace before running gettext(1) for other reasons later.\n>> >\n>> > It would add unnecessary churn, too, to add those specific exclusions and\n>> > make things inconsistent: the use of PRItime in Perl or shell scripts\n>> > would already make those scripts barf. And if it is unnecessary churn...\n>> > let's not do it?\n>> \n>> Sorry, but I cannot quite tell if you are in favor of limiting the\n>> set of source files that go through the sed substitution (because we\n>> know PRIuMAX is just as nonsensical as PRItime in perl and shell\n>> source), or if you are in favor of keeping the patch as-is (because\n>> changing the set of source files is a churn and substitutions would\n>> not hurt)?\n>\n> I was in favor of keeping the simplest strategy: simply cover all files,\n> including Perl and Unix shell scripts. It would not bring any benefit to\n> exclude them.\n\nOK.  I actually was OK to limit the potential damage to C sources,\nbut it does not matter that much in the bigger picture.\n\n"},{"id":"325070","messageId":"xmqqbmo8utqp.fsf@gitster.mtv.corp.google.com","threadId":"46389","inReplyTo":"alpine.DEB.2.21.1.1707251221160.4271@virtualbox","subject":"Re: [PATCH] PRItime: wrap PRItime for better l10n compatibility","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-07-25T20:49:50Z","receivedAt":"2017-07-25T20:49:59Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> On Sat, 22 Jul 2017, Junio C Hamano wrote:\n>\n>> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n>> \n>> >> >> A very small hack on gettext.\n>> >\n>> > I am 100% opposed to this hack. It is already cumbersome enough to find\n>> > out what is involved in i18n (it took *me* five minutes to find out that\n>> > much of the information is in po/README, with a lot of information stored\n>> > *on an external site*, and I still managed to miss the `make pot` target).\n>> >\n>> > If at all, we need to make things easier instead of harder.\n>> >\n>> > Requiring potential volunteers to waste their time to compile an\n>> > unnecessary fork of gettext? Not so great an idea.\n>> >\n>> > Plus, each and every Git build would now have to compile their own\n>> > gettext, too, as the vanilla one would not handle the .po files containing\n>> > %<PRItime>!!!\n>> >\n>> > And that requirement would impact instantaneously people like me, and even\n>> > worse: some other packagers might be unaware of the new requirement which\n>> > would not be caught during the build, and neither by the test suite.\n>> > Double bad idea.\n>> \n>> If I understand correctly, the patch hacks the input processing of\n>> xgettext (which reads our source code and generates po/git.pot) so\n>> that when it sees PRItime, pretend that it saw PRIuMAX, causing it\n>> to output %<PRIuMAX> in its output.\n>\n> Oh, I missed that. That's even worse, as it precludes what you were\n> wishing for: to replace timestamp_t by a signed data type eventually.\n\nYup, Jiang's plan was to update the custom edition of xgettext when\nit happens and the Makefile patch has a provision to avoid mistakes.\n\nIf Jiang's patch were extended so that xgettext would take a command\nline option \"--custom-priformat=PRItime=PRIuMAX\" and upstreamed\nand wildy deployed already, that would have been a good solution.\nThat might be a preferred outcome that may benefit other projects,\nbut it won't happen for at least 3 years if not more X-<.\n"}]}