git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Nieder <jrnieder@gmail.com>
To: Nguyen Thai Ngoc Duy <pclouds@gmail.com>
Cc: Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org
Subject: Re: [PATCH 1/2] i18n: leave \n out of translated diffstat
Date: Mon, 25 Jun 2012 06:33:29 -0500	[thread overview]
Message-ID: <20120625113328.GA9270@burratino> (raw)
In-Reply-To: <CACsJy8De_Toy+7jvsBueYZpcuakTxZupmwLYZVm29Ni3+1QuMw@mail.gmail.com>

Nguyen Thai Ngoc Duy wrote:

> That prints "0 files changed, 0 insertions(+), 0 deletions(-)" instead
> of "0 files changed". Two more changed lines to make it the latter.

Sloppy of me.  Yes, I meant

diff --git i/diff.c w/diff.c
index 1a594df4..287f310d 100644
--- i/diff.c
+++ w/diff.c
@@ -1395,11 +1395,6 @@ int print_stat_summary(FILE *fp, int files, int insertions, int deletions)
 	struct strbuf sb = STRBUF_INIT;
 	int ret;
 
-	if (!files) {
-		assert(insertions == 0 && deletions == 0);
-		return fputs(_(" 0 files changed\n"), fp);
-	}
-
 	strbuf_addf(&sb,
 		    Q_(" %d file changed", " %d files changed", files),
 		    files);
@@ -1412,7 +1407,7 @@ int print_stat_summary(FILE *fp, int files, int insertions, int deletions)
 	 * is probably less confusing (i.e skip over "2 files changed
 	 * but nothing about added/removed lines? Is this a bug in Git?").
 	 */
-	if (insertions || deletions == 0) {
+	if (insertions || (files && deletions == 0)) {
 		/*
 		 * TRANSLATORS: "+" in (+) is a line addition marker;
 		 * do not translate it.
@@ -1423,7 +1418,7 @@ int print_stat_summary(FILE *fp, int files, int insertions, int deletions)
 			    insertions);
 	}
 
-	if (deletions || insertions == 0) {
+	if (deletions || (files && insertions == 0)) {
 		/*
 		 * TRANSLATORS: "-" in (-) is a line removal marker;
 		 * do not translate it.

      reply	other threads:[~2012-06-25 11:33 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-24 12:41 [PATCH 1/2] i18n: leave \n out of translated diffstat Nguyễn Thái Ngọc Duy
2012-06-24 12:41 ` [PATCH 2/2] Add C_LOCALE_OUTPUT prereq to test cases that require English text matching Nguyễn Thái Ngọc Duy
2012-06-24 16:28   ` Jonathan Nieder
2012-06-25 11:32     ` Nguyen Thai Ngoc Duy
2012-06-25 11:39       ` Jonathan Nieder
2012-06-25 11:45       ` Nguyen Thai Ngoc Duy
2012-06-25 11:53         ` Jonathan Nieder
2012-06-24 16:04 ` [PATCH 1/2] i18n: leave \n out of translated diffstat Jonathan Nieder
2012-06-25  4:24   ` Junio C Hamano
2012-06-25 11:17     ` Nguyen Thai Ngoc Duy
2012-06-25 11:33       ` Jonathan Nieder [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120625113328.GA9270@burratino \
    --to=jrnieder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=pclouds@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).