{"thread":{"id":"29027","subject":"[PATCH] diff and apply: fix singular/plural grammar nit.","startedAt":"2011-11-27T13:44:21Z","lastAt":"2011-11-27T15:41:17Z","messageCount":4,"participants":["David Ripton","Jakub Narebski","Carlos Martín Nieto","Frans Klaver"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"180018","messageId":"4ED23EB5.1030208@ripton.net","threadId":"29027","inReplyTo":null,"subject":"[PATCH] diff and apply: fix singular/plural grammar nit.","fromName":"David Ripton","fromEmail":"dripton@ripton.net","sentAt":"2011-11-27T13:44:21Z","receivedAt":"2011-11-27T13:44:21Z","isPatch":true,"sender":{"key":"dripton@ripton.net","avatar":"https://avatars.githubusercontent.com/u/153528?v=4"},"body":"Remove the trailing 's' from \"files\", \"insertions\", and \"deletions\"\nwhen there is only one of the item.\n\nSigned-off-by: David Ripton <dripton@ripton.net>\n---\n  builtin/apply.c |    5 ++++-\n  diff.c          |   13 +++++++++----\n  2 files changed, 13 insertions(+), 5 deletions(-)\n\ndiff --git a/builtin/apply.c b/builtin/apply.c\nindex 84a8a0b..47bbc23 100644\n--- a/builtin/apply.c\n+++ b/builtin/apply.c\n@@ -3244,7 +3244,10 @@ static void stat_patch_list(struct patch *patch)\n                 show_stats(patch);\n         }\n\n-       printf(\" %d files changed, %d insertions(+), %d deletions(-)\\n\", \nfiles, adds, dels);\n+       printf(\" %d file%s changed, %d insertion%s(+), %d deletion%s(-)\\n\",\n+              files, (files == 1 ? \"\" : \"s\"),\n+              adds, (adds == 1 ? \"\" : \"s\"),\n+              dels, (dels == 1 ? \"\" : \"s\"));\n  }\n\n  static void numstat_patch_list(struct patch *patch)\ndiff --git a/diff.c b/diff.c\nindex 374ecf3..531dcb1 100644\n--- a/diff.c\n+++ b/diff.c\n@@ -1467,8 +1467,10 @@ static void show_stats(struct diffstat_t *data, \nstruct diff_options *options)\n         }\n         fprintf(options->file, \"%s\", line_prefix);\n         fprintf(options->file,\n-              \" %d files changed, %d insertions(+), %d deletions(-)\\n\",\n-              total_files, adds, dels);\n+              \" %d file%s changed, %d insertion%s(+), %d deletion%s(-)\\n\",\n+              total_files, (total_files == 1 ? \"\" : \"s\"),\n+              adds, (adds == 1 ? \"\" : \"s\"),\n+              dels, (dels == 1 ? \"\" : \"s\"));\n  }\n\n  static void show_shortstats(struct diffstat_t *data, struct \ndiff_options *options)\n@@ -1498,8 +1500,11 @@ static void show_shortstats(struct diffstat_t \n*data, struct diff_options *option\n                                 options->output_prefix_data);\n                 fprintf(options->file, \"%s\", msg->buf);\n         }\n-       fprintf(options->file, \" %d files changed, %d insertions(+), %d \ndeletions(-)\\n\",\n-              total_files, adds, dels);\n+       fprintf(options->file,\n+               \" %d file%s changed, %d insertion%s(+), %d deletion%s(-)\\n\",\n+               total_files, (total_files == 1 ? \"\" : \"s\"),\n+               adds, (adds == 1 ? \"\" : \"s\"),\n+               dels, (dels == 1 ? \"\" : \"s\"));\n  }\n\n  static void show_numstat(struct diffstat_t *data, struct diff_options \n*options)\n-- \n1.7.8.rc3\n\n-- \nDavid Ripton    dripton@ripton.net\n"},{"id":"180019","messageId":"m37h2lmxk9.fsf@localhost.localdomain","threadId":"29027","inReplyTo":"4ED23EB5.1030208@ripton.net","subject":"Re: [PATCH] diff and apply: fix singular/plural grammar nit.","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2011-11-27T14:47:21Z","receivedAt":"2011-11-27T14:47:21Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"David Ripton <dripton@ripton.net> writes:\n\n> Remove the trailing 's' from \"files\", \"insertions\", and \"deletions\"\n> when there is only one of the item.\n> \n> Signed-off-by: David Ripton <dripton@ripton.net>\n> ---\n[...]\n> -       printf(\" %d files changed, %d insertions(+), %d\n> deletions(-)\\n\", files, adds, dels);\n\nWhitespace damaged.  Please turn off word wrapping (limiting line\nwidth) when sending patches.\n\n> +       printf(\" %d file%s changed, %d insertion%s(+), %d deletion%s(-)\\n\",\n> +              files, (files == 1 ? \"\" : \"s\"),\n> +              adds, (adds == 1 ? \"\" : \"s\"),\n> +              dels, (dels == 1 ? \"\" : \"s\"));\n>   }\n\nFirst, I think this is an API / plumbing and should not be changed.\nBut I might be mistaken about that.\n\nSecond, it is a perfect example ho to *not* handle plural form in the\npresence of internationalization (i18n) efforts.  See e.g.\n\n  http://www.gnu.org/s/hello/manual/gettext/Plural-forms.html\n\n-- \nJakub Narębski\n"},{"id":"180020","messageId":"20111127145033.GA1738@centaur.lab.cmartin.tk","threadId":"29027","inReplyTo":"m37h2lmxk9.fsf@localhost.localdomain","subject":"Re: [PATCH] diff and apply: fix singular/plural grammar nit.","fromName":"Carlos Martín Nieto","fromEmail":"cmn@elego.de","sentAt":"2011-11-27T14:50:33Z","receivedAt":"2011-11-27T14:50:33Z","isPatch":true,"sender":{"key":"cmn@elego.de","avatar":"https://avatars.githubusercontent.com/u/335443?v=4"},"body":"On Sun, Nov 27, 2011 at 06:47:21AM -0800, Jakub Narebski wrote:\n> David Ripton <dripton@ripton.net> writes:\n> \n> > Remove the trailing 's' from \"files\", \"insertions\", and \"deletions\"\n> > when there is only one of the item.\n> > \n> > Signed-off-by: David Ripton <dripton@ripton.net>\n> > ---\n> [...]\n> > -       printf(\" %d files changed, %d insertions(+), %d\n> > deletions(-)\\n\", files, adds, dels);\n> \n> Whitespace damaged.  Please turn off word wrapping (limiting line\n> width) when sending patches.\n> \n> > +       printf(\" %d file%s changed, %d insertion%s(+), %d deletion%s(-)\\n\",\n> > +              files, (files == 1 ? \"\" : \"s\"),\n> > +              adds, (adds == 1 ? \"\" : \"s\"),\n> > +              dels, (dels == 1 ? \"\" : \"s\"));\n> >   }\n> \n> First, I think this is an API / plumbing and should not be changed.\n> But I might be mistaken about that.\n\nI think somebody already tried to do this not too long ago (don't know\nif there as a patch) but the diffstat tool always uses the plural, and\nit might break scripts.\n\n   cmn\n\n\n"},{"id":"180021","messageId":"op.v5l263eh0aolir@keputer","threadId":"29027","inReplyTo":"20111127145033.GA1738@centaur.lab.cmartin.tk","subject":"Re: [PATCH] diff and apply: fix singular/plural grammar nit.","fromName":"Frans Klaver","fromEmail":"fransklaver@gmail.com","sentAt":"2011-11-27T15:41:17Z","receivedAt":"2011-11-27T15:41:17Z","isPatch":true,"sender":{"key":"fransklaver@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1876483?v=4"},"body":"On Sun, 27 Nov 2011 15:50:33 +0100, Carlos Martín Nieto <cmn@elego.de>  \nwrote:\n\n> I think somebody already tried to do this not too long ago (don't know\n> if there as a patch) but the diffstat tool always uses the plural, and\n> it might break scripts.\n\nThat would be http://thread.gmane.org/gmane.comp.version-control.git/178316\n\nFrans\n"}]}