From: David Ripton <dripton@ripton.net>
To: git@vger.kernel.org, gitster@pobox.com
Subject: [PATCH] diff and apply: fix singular/plural grammar nit.
Date: Sun, 27 Nov 2011 08:44:21 -0500 [thread overview]
Message-ID: <4ED23EB5.1030208@ripton.net> (raw)
Remove the trailing 's' from "files", "insertions", and "deletions"
when there is only one of the item.
Signed-off-by: David Ripton <dripton@ripton.net>
---
builtin/apply.c | 5 ++++-
diff.c | 13 +++++++++----
2 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/builtin/apply.c b/builtin/apply.c
index 84a8a0b..47bbc23 100644
--- a/builtin/apply.c
+++ b/builtin/apply.c
@@ -3244,7 +3244,10 @@ static void stat_patch_list(struct patch *patch)
show_stats(patch);
}
- printf(" %d files changed, %d insertions(+), %d deletions(-)\n",
files, adds, dels);
+ printf(" %d file%s changed, %d insertion%s(+), %d deletion%s(-)\n",
+ files, (files == 1 ? "" : "s"),
+ adds, (adds == 1 ? "" : "s"),
+ dels, (dels == 1 ? "" : "s"));
}
static void numstat_patch_list(struct patch *patch)
diff --git a/diff.c b/diff.c
index 374ecf3..531dcb1 100644
--- a/diff.c
+++ b/diff.c
@@ -1467,8 +1467,10 @@ static void show_stats(struct diffstat_t *data,
struct diff_options *options)
}
fprintf(options->file, "%s", line_prefix);
fprintf(options->file,
- " %d files changed, %d insertions(+), %d deletions(-)\n",
- total_files, adds, dels);
+ " %d file%s changed, %d insertion%s(+), %d deletion%s(-)\n",
+ total_files, (total_files == 1 ? "" : "s"),
+ adds, (adds == 1 ? "" : "s"),
+ dels, (dels == 1 ? "" : "s"));
}
static void show_shortstats(struct diffstat_t *data, struct
diff_options *options)
@@ -1498,8 +1500,11 @@ static void show_shortstats(struct diffstat_t
*data, struct diff_options *option
options->output_prefix_data);
fprintf(options->file, "%s", msg->buf);
}
- fprintf(options->file, " %d files changed, %d insertions(+), %d
deletions(-)\n",
- total_files, adds, dels);
+ fprintf(options->file,
+ " %d file%s changed, %d insertion%s(+), %d deletion%s(-)\n",
+ total_files, (total_files == 1 ? "" : "s"),
+ adds, (adds == 1 ? "" : "s"),
+ dels, (dels == 1 ? "" : "s"));
}
static void show_numstat(struct diffstat_t *data, struct diff_options
*options)
--
1.7.8.rc3
--
David Ripton dripton@ripton.net
next reply other threads:[~2011-11-27 13:45 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-27 13:44 David Ripton [this message]
2011-11-27 14:47 ` [PATCH] diff and apply: fix singular/plural grammar nit Jakub Narebski
2011-11-27 14:50 ` Carlos Martín Nieto
2011-11-27 15:41 ` Frans Klaver
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=4ED23EB5.1030208@ripton.net \
--to=dripton@ripton.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.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 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.