All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] git-status: make porcelain more robust
@ 2017-03-14 16:02 Michael J Gruber
  2017-03-14 22:05 ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Michael J Gruber @ 2017-03-14 16:02 UTC (permalink / raw)
  To: git; +Cc: Matthieu Moy

git status provides a porcelain mode for porcelain writers with a
supposedly stable (plumbing) interface.
7a76c28ff2 ("status: disable translation when --porcelain is used", 2014-03-20)
made sure that ahead/behind info is not translated (i.e. is stable).

Make sure that the remaining two strings (initial commit, detached head)
are stable, too.

These changes are for the v1 porcelain interface. While we do have a perfectly
stable v2 porcelain interface now, some tools (such as
powerline-gitstatus) are written against v1 and profit from fixing v1
without any changes on their side.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
---
 wt-status.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/wt-status.c b/wt-status.c
index d47012048f..234e77a6d6 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -1730,12 +1730,14 @@ static void wt_shortstatus_print_tracking(struct wt_status *s)
 		return;
 	branch_name = s->branch;
 
+#define LABEL(string) (s->no_gettext ? (string) : _(string))
+
 	if (s->is_initial)
-		color_fprintf(s->fp, header_color, _("Initial commit on "));
+		color_fprintf(s->fp, header_color, LABEL(N_("Initial commit on ")));
 
 	if (!strcmp(s->branch, "HEAD")) {
 		color_fprintf(s->fp, color(WT_STATUS_NOBRANCH, s), "%s",
-			      _("HEAD (no branch)"));
+			      LABEL(N_("HEAD (no branch)")));
 		goto conclude;
 	}
 
@@ -1760,8 +1762,6 @@ static void wt_shortstatus_print_tracking(struct wt_status *s)
 	if (!upstream_is_gone && !num_ours && !num_theirs)
 		goto conclude;
 
-#define LABEL(string) (s->no_gettext ? (string) : _(string))
-
 	color_fprintf(s->fp, header_color, " [");
 	if (upstream_is_gone) {
 		color_fprintf(s->fp, header_color, LABEL(N_("gone")));
-- 
2.12.0.384.g157040b11f.dirty


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

* Re: [PATCH] git-status: make porcelain more robust
  2017-03-14 16:02 [PATCH] git-status: make porcelain more robust Michael J Gruber
@ 2017-03-14 22:05 ` Junio C Hamano
  2017-03-15  7:13   ` Matthieu Moy
  0 siblings, 1 reply; 3+ messages in thread
From: Junio C Hamano @ 2017-03-14 22:05 UTC (permalink / raw)
  To: Michael J Gruber; +Cc: git, Matthieu Moy

Michael J Gruber <git@drmicha.warpmail.net> writes:

> git status provides a porcelain mode for porcelain writers with a
> supposedly stable (plumbing) interface.
> 7a76c28ff2 ("status: disable translation when --porcelain is used", 2014-03-20)
> made sure that ahead/behind info is not translated (i.e. is stable).
>
> Make sure that the remaining two strings (initial commit, detached head)
> are stable, too.

It seems to me that 7a76c28ff2 already missed these strings, and
their _() markings survive to this day.  Thanks for spotting and
fixing.

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

* Re: [PATCH] git-status: make porcelain more robust
  2017-03-14 22:05 ` Junio C Hamano
@ 2017-03-15  7:13   ` Matthieu Moy
  0 siblings, 0 replies; 3+ messages in thread
From: Matthieu Moy @ 2017-03-15  7:13 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Michael J Gruber, git

Junio C Hamano <gitster@pobox.com> writes:

> Michael J Gruber <git@drmicha.warpmail.net> writes:
>
>> git status provides a porcelain mode for porcelain writers with a
>> supposedly stable (plumbing) interface.
>> 7a76c28ff2 ("status: disable translation when --porcelain is used", 2014-03-20)
>> made sure that ahead/behind info is not translated (i.e. is stable).
>>
>> Make sure that the remaining two strings (initial commit, detached head)
>> are stable, too.
>
> It seems to me that 7a76c28ff2 already missed these strings, and
> their _() markings survive to this day.  Thanks for spotting and
> fixing.

Yep, sounds all right to me. Thanks,

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

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

end of thread, other threads:[~2017-03-15  7:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-14 16:02 [PATCH] git-status: make porcelain more robust Michael J Gruber
2017-03-14 22:05 ` Junio C Hamano
2017-03-15  7:13   ` Matthieu Moy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.