提交 b9e2bc56 编写于 作者: M Michael J Gruber 提交者: Junio C Hamano

git-status: make porcelain more robust

git status provides a porcelain mode for porcelain writers with a
supposedly stable (plumbing) interface.
7a76c28f ("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: NMichael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 c3808ca6
......@@ -1661,12 +1661,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;
}
......@@ -1691,8 +1693,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")));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册