{"thread":{"id":"45374","subject":"[PATCH] git-status: make porcelain more robust","startedAt":"2017-03-14T16:03:23Z","lastAt":"2017-03-15T07:14:07Z","messageCount":3,"participants":["Michael J Gruber","Junio C Hamano","Matthieu Moy"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"314033","messageId":"54df68bd46f7a417e77eb71b636f6f7afd4fce75.1489507239.git.git@drmicha.warpmail.net","threadId":"45374","inReplyTo":null,"subject":"[PATCH] git-status: make porcelain more robust","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2017-03-14T16:02:02Z","receivedAt":"2017-03-14T16:03:23Z","isPatch":true,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"git status provides a porcelain mode for porcelain writers with a\nsupposedly stable (plumbing) interface.\n7a76c28ff2 (\"status: disable translation when --porcelain is used\", 2014-03-20)\nmade sure that ahead/behind info is not translated (i.e. is stable).\n\nMake sure that the remaining two strings (initial commit, detached head)\nare stable, too.\n\nThese changes are for the v1 porcelain interface. While we do have a perfectly\nstable v2 porcelain interface now, some tools (such as\npowerline-gitstatus) are written against v1 and profit from fixing v1\nwithout any changes on their side.\n\nSigned-off-by: Michael J Gruber <git@drmicha.warpmail.net>\n---\n wt-status.c | 8 ++++----\n 1 file changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/wt-status.c b/wt-status.c\nindex d47012048f..234e77a6d6 100644\n--- a/wt-status.c\n+++ b/wt-status.c\n@@ -1730,12 +1730,14 @@ static void wt_shortstatus_print_tracking(struct wt_status *s)\n \t\treturn;\n \tbranch_name = s->branch;\n \n+#define LABEL(string) (s->no_gettext ? (string) : _(string))\n+\n \tif (s->is_initial)\n-\t\tcolor_fprintf(s->fp, header_color, _(\"Initial commit on \"));\n+\t\tcolor_fprintf(s->fp, header_color, LABEL(N_(\"Initial commit on \")));\n \n \tif (!strcmp(s->branch, \"HEAD\")) {\n \t\tcolor_fprintf(s->fp, color(WT_STATUS_NOBRANCH, s), \"%s\",\n-\t\t\t      _(\"HEAD (no branch)\"));\n+\t\t\t      LABEL(N_(\"HEAD (no branch)\")));\n \t\tgoto conclude;\n \t}\n \n@@ -1760,8 +1762,6 @@ static void wt_shortstatus_print_tracking(struct wt_status *s)\n \tif (!upstream_is_gone && !num_ours && !num_theirs)\n \t\tgoto conclude;\n \n-#define LABEL(string) (s->no_gettext ? (string) : _(string))\n-\n \tcolor_fprintf(s->fp, header_color, \" [\");\n \tif (upstream_is_gone) {\n \t\tcolor_fprintf(s->fp, header_color, LABEL(N_(\"gone\")));\n-- \n2.12.0.384.g157040b11f.dirty\n\n"},{"id":"314088","messageId":"xmqq8to7h5tr.fsf@gitster.mtv.corp.google.com","threadId":"45374","inReplyTo":"54df68bd46f7a417e77eb71b636f6f7afd4fce75.1489507239.git.git@drmicha.warpmail.net","subject":"Re: [PATCH] git-status: make porcelain more robust","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-03-14T22:05:52Z","receivedAt":"2017-03-14T22:05:59Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Michael J Gruber <git@drmicha.warpmail.net> writes:\n\n> git status provides a porcelain mode for porcelain writers with a\n> supposedly stable (plumbing) interface.\n> 7a76c28ff2 (\"status: disable translation when --porcelain is used\", 2014-03-20)\n> made sure that ahead/behind info is not translated (i.e. is stable).\n>\n> Make sure that the remaining two strings (initial commit, detached head)\n> are stable, too.\n\nIt seems to me that 7a76c28ff2 already missed these strings, and\ntheir _() markings survive to this day.  Thanks for spotting and\nfixing.\n"},{"id":"314122","messageId":"vpqvarbau7y.fsf@anie.imag.fr","threadId":"45374","inReplyTo":"xmqq8to7h5tr.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH] git-status: make porcelain more robust","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2017-03-15T07:13:05Z","receivedAt":"2017-03-15T07:14:07Z","isPatch":true,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Michael J Gruber <git@drmicha.warpmail.net> writes:\n>\n>> git status provides a porcelain mode for porcelain writers with a\n>> supposedly stable (plumbing) interface.\n>> 7a76c28ff2 (\"status: disable translation when --porcelain is used\", 2014-03-20)\n>> made sure that ahead/behind info is not translated (i.e. is stable).\n>>\n>> Make sure that the remaining two strings (initial commit, detached head)\n>> are stable, too.\n>\n> It seems to me that 7a76c28ff2 already missed these strings, and\n> their _() markings survive to this day.  Thanks for spotting and\n> fixing.\n\nYep, sounds all right to me. Thanks,\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"}]}