{"thread":{"id":"27974","subject":"[PATCH] For Real - Fixed pluralization in diff reports","startedAt":"2011-08-01T04:46:06Z","lastAt":"2011-08-03T16:52:57Z","messageCount":12,"participants":["Jon Forrest","Nguyen Thai Ngoc Duy","Sverre Rabbelier","Jeff King","Jakub Narebski"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"172507","messageId":"4E362F8E.1050105@gmail.com","threadId":"27974","inReplyTo":null,"subject":"[PATCH] For Real - Fixed pluralization in diff reports","fromName":"Jon Forrest","fromEmail":"nobozo@gmail.com","sentAt":"2011-08-01T04:46:06Z","receivedAt":"2011-08-01T04:46:06Z","isPatch":true,"sender":{"key":"nobozo@gmail.com","avatar":"https://gravatar.com/avatar/37c6a7b57f29b3f35c6a9016537907c52f15bbf98575617dc046bcec6bf06372?d=mp&s=160"},"body":"[I must have accidentally removed the \"s\" in \"deletions\" before.\nI just rebuilt everything and remade the patch. All looks well\nthis time. This is my first submitted patch to anything\nso my fingers are still learning.]\n\nI got irritated by the\n\n      1 files changed, 0 insertions(+), 1 deletions(-)\n\nlack of pluralization so I fixed it. Now it says\n\n      1 file changed, 0 insertions(+), 1 deletion(-)\n\nand so forth.\n\nSigned-off-by: Jon Forrest <nobozo@gmail.com>\n---\n  diff.c |   10 ++++++----\n  1 file changed, 6 insertions(+), 4 deletions(-)\n\ndiff --git a/diff.c b/diff.c\nindex 93ef9a2..a179b24 100644\n--- a/diff.c\n+++ b/diff.c\n@@ -1465,8 +1465,9 @@ static void show_stats(struct diffstat_t *data, \nstruct diff_options *options)\n  \t}\n  \tfprintf(options->file, \"%s\", line_prefix);\n  \tfprintf(options->file,\n-\t       \" %d files changed, %d insertions(+), %d deletions(-)\\n\",\n-\t       total_files, adds, dels);\n+\t       \" %d file%s changed, %d insertion%s(+), %d deletion%s(-)\\n\",\n+\t       total_files, total_files == 1 ? \"\" : \"s\", adds, adds == 1 ? \"\" \n: \"s\", dels,\n+\t\tdels == 1 ? \"\" : \"s\");\n  }\n\n  static void show_shortstats(struct diffstat_t *data, struct \ndiff_options *options)\n@@ -1496,8 +1497,9 @@ static void show_shortstats(struct diffstat_t \n*data, struct diff_options *option\n  \t\t\t\toptions->output_prefix_data);\n  \t\tfprintf(options->file, \"%s\", msg->buf);\n  \t}\n-\tfprintf(options->file, \" %d files changed, %d insertions(+), %d \ndeletions(-)\\n\",\n-\t       total_files, adds, dels);\n+\tfprintf(options->file, \" %d file%s changed, %d insertion%s(+), %d \ndeletion%s(-)\\n\",\n+\t       total_files, total_files == 1 ? \"\" : \"s\", adds, adds == 1 ? \"\" \n: \"s\", dels,\n+\t\tdels == 1 ? \"\" : \"s\");\n  }\n\n  static void show_numstat(struct diffstat_t *data, struct diff_options \n*options)\n-- 1.7.6.351.gb35ac.dirty\n"},{"id":"172508","messageId":"CACsJy8CdfRCssfrMVOjRn2a_=vZPLyG_uEd4fS2WxzQXKZGn3w@mail.gmail.com","threadId":"27974","inReplyTo":"4E362F8E.1050105@gmail.com","subject":"Re: [PATCH] For Real - Fixed pluralization in diff reports","fromName":"Nguyen Thai Ngoc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2011-08-01T04:50:20Z","receivedAt":"2011-08-01T04:50:20Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Mon, Aug 1, 2011 at 11:46 AM, Jon Forrest <nobozo@gmail.com> wrote:\n> [I must have accidentally removed the \"s\" in \"deletions\" before.\n> I just rebuilt everything and remade the patch. All looks well\n> this time. This is my first submitted patch to anything\n> so my fingers are still learning.]\n>\n> I got irritated by the\n>\n>     1 files changed, 0 insertions(+), 1 deletions(-)\n>\n> lack of pluralization so I fixed it. Now it says\n>\n>     1 file changed, 0 insertions(+), 1 deletion(-)\n>\n> and so forth.\n\nAre you sure this does not break any tests? t3508.2 for example\nhardcodes \"1 insertions\" and does textual compare. I have not run the\ntests but I suspect it will fail.\n-- \nDuy\n"},{"id":"172509","messageId":"4E36321E.2040409@gmail.com","threadId":"27974","inReplyTo":"CACsJy8CdfRCssfrMVOjRn2a_=vZPLyG_uEd4fS2WxzQXKZGn3w@mail.gmail.com","subject":"Re: [PATCH] For Real - Fixed pluralization in diff reports","fromName":"Jon Forrest","fromEmail":"nobozo@gmail.com","sentAt":"2011-08-01T04:57:02Z","receivedAt":"2011-08-01T04:57:02Z","isPatch":true,"sender":{"key":"nobozo@gmail.com","avatar":"https://gravatar.com/avatar/37c6a7b57f29b3f35c6a9016537907c52f15bbf98575617dc046bcec6bf06372?d=mp&s=160"},"body":"On 7/31/2011 9:50 PM, Nguyen Thai Ngoc Duy wrote:\n\n> Are you sure this does not break any tests? t3508.2 for example\n> hardcodes \"1 insertions\" and does textual compare. I have not run the\n> tests but I suspect it will fail.\n\nI ran the tests. The only result in red that I saw that\ndidn't appear to be caused \"by breakage\" was\n\nnot ok - 3 mktemp to unwritable directory prints filename\n\nSince I didn't do anything relating to mktemp I thought\nthis was probably bogus.\n\nI'm new to this so I don't know how to find the t3508.2.\nIf you can give me a hint I'd be glad to look at this in\nmore detail.\n\nJon\n"},{"id":"172512","messageId":"CACsJy8DZ8WW0g-3Cmobft8FtfciYrGYA+eqA4ogkX9BktukWZg@mail.gmail.com","threadId":"27974","inReplyTo":"4E36321E.2040409@gmail.com","subject":"Re: [PATCH] For Real - Fixed pluralization in diff reports","fromName":"Nguyen Thai Ngoc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2011-08-01T05:21:47Z","receivedAt":"2011-08-01T05:21:47Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Mon, Aug 1, 2011 at 11:57 AM, Jon Forrest <nobozo@gmail.com> wrote:\n> On 7/31/2011 9:50 PM, Nguyen Thai Ngoc Duy wrote:\n>\n>> Are you sure this does not break any tests? t3508.2 for example\n>> hardcodes \"1 insertions\" and does textual compare. I have not run the\n>> tests but I suspect it will fail.\n>\n> I ran the tests. The only result in red that I saw that\n> didn't appear to be caused \"by breakage\" was\n>\n> not ok - 3 mktemp to unwritable directory prints filename\n>\n> Since I didn't do anything relating to mktemp I thought\n> this was probably bogus.\n>\n> I'm new to this so I don't know how to find the t3508.2.\n> If you can give me a hint I'd be glad to look at this in\n> more detail.\n\nYour patch is line-wrapped. Please see\nDocumentation/SubmittingPatches, it may help.\n\nI manually applied your patch and run t3508 alone. t3508.2 is the\nsecond test in t3502, by the way. t/README gives more information on\ntests of git.\n\npclouds@do ~/w/git/t $ ./t3508-cherry-pick-many-commits.sh  -v\nInitialized empty Git repository in /home/pclouds/w/git/t/trash\ndirectory.t3508-cherry-pick-many-commits/.git/\nexpecting success:\n\techo first > file1 &&\n\tgit add file1 &&\n\ttest_tick &&\n\tgit commit -m \"first\" &&\n\tgit tag first &&\n\n\tgit checkout -b other &&\n\tfor val in second third fourth\n\tdo\n\t\techo $val >> file1 &&\n\t\tgit add file1 &&\n\t\ttest_tick &&\n\t\tgit commit -m \"$val\" &&\n\t\tgit tag $val\n\tdone\n\n[master (root-commit) 0c72e4f] first\n Author: A U Thor <author@example.com>\n 1 file changed, 1 insertion(+), 0 deletions(-)\n create mode 100644 file1\n[other 453a047] second\n Author: A U Thor <author@example.com>\n 1 file changed, 1 insertion(+), 0 deletions(-)\n[other e85abe2] third\n Author: A U Thor <author@example.com>\n 1 file changed, 1 insertion(+), 0 deletions(-)\n[other 94d3184] fourth\n Author: A U Thor <author@example.com>\n 1 file changed, 1 insertion(+), 0 deletions(-)\nok 1 - setup\n\nexpecting success:\n\tcat <<-\\EOF >expected &&\n\t[master OBJID] second\n\t Author: A U Thor <author@example.com>\n\t 1 files changed, 1 insertions(+), 0 deletions(-)\n\t[master OBJID] third\n\t Author: A U Thor <author@example.com>\n\t 1 files changed, 1 insertions(+), 0 deletions(-)\n\t[master OBJID] fourth\n\t Author: A U Thor <author@example.com>\n\t 1 files changed, 1 insertions(+), 0 deletions(-)\n\tEOF\n\n\tgit checkout -f master &&\n\tgit reset --hard first &&\n\ttest_tick &&\n\tgit cherry-pick first..fourth >actual &&\n\tgit diff --quiet other &&\n\tgit diff --quiet HEAD other &&\n\n\tsed -e \"s/$_x05[0-9a-f][0-9a-f]/OBJID/\" <actual >actual.fuzzy &&\n\ttest_cmp expected actual.fuzzy &&\n\tcheck_head_differs_from fourth\n\nHEAD is now at 0c72e4f first\n--- expected\t2011-08-01 05:13:03.000000000 +0000\n+++ actual.fuzzy\t2011-08-01 05:13:04.000000000 +0000\n@@ -1,9 +1,9 @@\n [master OBJID] second\n  Author: A U Thor <author@example.com>\n- 1 files changed, 1 insertions(+), 0 deletions(-)\n+ 1 file changed, 1 insertion(+), 0 deletions(-)\n [master OBJID] third\n  Author: A U Thor <author@example.com>\n- 1 files changed, 1 insertions(+), 0 deletions(-)\n+ 1 file changed, 1 insertion(+), 0 deletions(-)\n [master OBJID] fourth\n  Author: A U Thor <author@example.com>\n- 1 files changed, 1 insertions(+), 0 deletions(-)\n+ 1 file changed, 1 insertion(+), 0 deletions(-)\nnot ok - 2 cherry-pick first..fourth works\n#\t\n#\t\tcat <<-\\EOF >expected &&\n#\t\t[master OBJID] second\n#\t\t Author: A U Thor <author@example.com>\n#\t\t 1 files changed, 1 insertions(+), 0 deletions(-)\n#\t\t[master OBJID] third\n#\t\t Author: A U Thor <author@example.com>\n#\t\t 1 files changed, 1 insertions(+), 0 deletions(-)\n#\t\t[master OBJID] fourth\n#\t\t Author: A U Thor <author@example.com>\n#\t\t 1 files changed, 1 insertions(+), 0 deletions(-)\n#\t\tEOF\n#\t\n#\t\tgit checkout -f master &&\n#\t\tgit reset --hard first &&\n#\t\ttest_tick &&\n#\t\tgit cherry-pick first..fourth >actual &&\n#\t\tgit diff --quiet other &&\n#\t\tgit diff --quiet HEAD other &&\n#\t\n#\t\tsed -e \"s/$_x05[0-9a-f][0-9a-f]/OBJID/\" <actual >actual.fuzzy &&\n#\t\ttest_cmp expected actual.fuzzy &&\n#\t\tcheck_head_differs_from fourth\n#\t\n\nexpecting success:\n\tcat <<-\\EOF >expected &&\n\tTrying simple merge.\n\t[master OBJID] second\n\t Author: A U Thor <author@example.com>\n\t 1 files changed, 1 insertions(+), 0 deletions(-)\n\tTrying simple merge.\n\t[master OBJID] third\n\t Author: A U Thor <author@example.com>\n\t 1 files changed, 1 insertions(+), 0 deletions(-)\n\tTrying simple merge.\n\t[master OBJID] fourth\n\t Author: A U Thor <author@example.com>\n\t 1 files changed, 1 insertions(+), 0 deletions(-)\n\tEOF\n\n\tgit checkout -f master &&\n\tgit reset --hard first &&\n\ttest_tick &&\n\tgit cherry-pick --strategy resolve first..fourth >actual &&\n\tgit diff --quiet other &&\n\tgit diff --quiet HEAD other &&\n\tsed -e \"s/$_x05[0-9a-f][0-9a-f]/OBJID/\" <actual >actual.fuzzy &&\n\ttest_cmp expected actual.fuzzy &&\n\tcheck_head_differs_from fourth\n\nHEAD is now at 0c72e4f first\n--- expected\t2011-08-01 05:13:04.000000000 +0000\n+++ actual.fuzzy\t2011-08-01 05:13:04.000000000 +0000\n@@ -1,12 +1,12 @@\n Trying simple merge.\n [master OBJID] second\n  Author: A U Thor <author@example.com>\n- 1 files changed, 1 insertions(+), 0 deletions(-)\n+ 1 file changed, 1 insertion(+), 0 deletions(-)\n Trying simple merge.\n [master OBJID] third\n  Author: A U Thor <author@example.com>\n- 1 files changed, 1 insertions(+), 0 deletions(-)\n+ 1 file changed, 1 insertion(+), 0 deletions(-)\n Trying simple merge.\n [master OBJID] fourth\n  Author: A U Thor <author@example.com>\n- 1 files changed, 1 insertions(+), 0 deletions(-)\n+ 1 file changed, 1 insertion(+), 0 deletions(-)\nnot ok - 3 cherry-pick --strategy resolve first..fourth works\n#\t\n#\t\tcat <<-\\EOF >expected &&\n#\t\tTrying simple merge.\n#\t\t[master OBJID] second\n#\t\t Author: A U Thor <author@example.com>\n#\t\t 1 files changed, 1 insertions(+), 0 deletions(-)\n#\t\tTrying simple merge.\n#\t\t[master OBJID] third\n#\t\t Author: A U Thor <author@example.com>\n#\t\t 1 files changed, 1 insertions(+), 0 deletions(-)\n#\t\tTrying simple merge.\n#\t\t[master OBJID] fourth\n#\t\t Author: A U Thor <author@example.com>\n#\t\t 1 files changed, 1 insertions(+), 0 deletions(-)\n#\t\tEOF\n#\t\n#\t\tgit checkout -f master &&\n#\t\tgit reset --hard first &&\n#\t\ttest_tick &&\n#\t\tgit cherry-pick --strategy resolve first..fourth >actual &&\n#\t\tgit diff --quiet other &&\n#\t\tgit diff --quiet HEAD other &&\n#\t\tsed -e \"s/$_x05[0-9a-f][0-9a-f]/OBJID/\" <actual >actual.fuzzy &&\n#\t\ttest_cmp expected actual.fuzzy &&\n#\t\tcheck_head_differs_from fourth\n#\t\n\nexpecting success:\n\tgit checkout -f master &&\n\tgit reset --hard first &&\n\ttest_tick &&\n\tgit cherry-pick --ff first..fourth &&\n\tgit diff --quiet other &&\n\tgit diff --quiet HEAD other &&\n\tcheck_head_equals fourth\n\nHEAD is now at 0c72e4f first\nok 4 - cherry-pick --ff first..fourth works\n\nexpecting success:\n\tgit checkout -f master &&\n\tgit reset --hard first &&\n\ttest_tick &&\n\tgit cherry-pick -n first..fourth &&\n\tgit diff --quiet other &&\n\tgit diff --cached --quiet other &&\n\tgit diff --quiet HEAD first\n\nHEAD is now at 0c72e4f first\nok 5 - cherry-pick -n first..fourth works\n\nexpecting success:\n\tgit checkout -f master &&\n\tgit reset --hard fourth &&\n\ttest_tick &&\n\tgit revert first..fourth &&\n\tgit diff --quiet first &&\n\tgit diff --cached --quiet first &&\n\tgit diff --quiet HEAD first\n\nHEAD is now at 94d3184 fourth\n[master c20509a] Revert \"fourth\"\n Author: A U Thor <author@example.com>\n 1 file changed, 0 insertions(+), 1 deletion(-)\n[master 5c15a57] Revert \"third\"\n Author: A U Thor <author@example.com>\n 1 file changed, 0 insertions(+), 1 deletion(-)\n[master 76d1a2e] Revert \"second\"\n Author: A U Thor <author@example.com>\n 1 file changed, 0 insertions(+), 1 deletion(-)\nok 6 - revert first..fourth works\n\nexpecting success:\n\tgit checkout -f master &&\n\tgit reset --hard fourth &&\n\ttest_tick &&\n\tgit revert ^first fourth &&\n\tgit diff --quiet first &&\n\tgit diff --cached --quiet first &&\n\tgit diff --quiet HEAD first\n\nHEAD is now at 94d3184 fourth\n[master aa52aa6] Revert \"fourth\"\n Author: A U Thor <author@example.com>\n 1 file changed, 0 insertions(+), 1 deletion(-)\n[master 7128690] Revert \"third\"\n Author: A U Thor <author@example.com>\n 1 file changed, 0 insertions(+), 1 deletion(-)\n[master 2b0bc01] Revert \"second\"\n Author: A U Thor <author@example.com>\n 1 file changed, 0 insertions(+), 1 deletion(-)\nok 7 - revert ^first fourth works\n\nexpecting success:\n\tgit checkout -f master &&\n\tgit reset --hard fourth &&\n\ttest_tick &&\n\tgit revert fourth fourth~1 fourth~2 &&\n\tgit diff --quiet first &&\n\tgit diff --cached --quiet first &&\n\tgit diff --quiet HEAD first\n\nHEAD is now at 94d3184 fourth\n[master e7406a3] Revert \"fourth\"\n Author: A U Thor <author@example.com>\n 1 file changed, 0 insertions(+), 1 deletion(-)\n[master 0039f72] Revert \"third\"\n Author: A U Thor <author@example.com>\n 1 file changed, 0 insertions(+), 1 deletion(-)\n[master 6fceae4] Revert \"second\"\n Author: A U Thor <author@example.com>\n 1 file changed, 0 insertions(+), 1 deletion(-)\nok 8 - revert fourth fourth~1 fourth~2 works\n\nexpecting success:\n\tgit checkout -f master &&\n\tgit reset --hard first &&\n\ttest_tick &&\n\tgit cherry-pick -3 fourth &&\n\tgit diff --quiet other &&\n\tgit diff --quiet HEAD other &&\n\tcheck_head_differs_from fourth\n\nHEAD is now at 0c72e4f first\n[master de54420] second\n Author: A U Thor <author@example.com>\n 1 file changed, 1 insertion(+), 0 deletions(-)\n[master 5fbc3d8] third\n Author: A U Thor <author@example.com>\n 1 file changed, 1 insertion(+), 0 deletions(-)\n[master 0f9850f] fourth\n Author: A U Thor <author@example.com>\n 1 file changed, 1 insertion(+), 0 deletions(-)\nok 9 - cherry-pick -3 fourth works\n\nexpecting success:\n\tgit checkout -f master &&\n\tgit reset --hard first &&\n\ttest_tick &&\n\tgit rev-list --reverse first..fourth | git cherry-pick --stdin &&\n\tgit diff --quiet other &&\n\tgit diff --quiet HEAD other &&\n\tcheck_head_differs_from fourth\n\nHEAD is now at 0c72e4f first\n[master 058f589] second\n Author: A U Thor <author@example.com>\n 1 file changed, 1 insertion(+), 0 deletions(-)\n[master 013cb83] third\n Author: A U Thor <author@example.com>\n 1 file changed, 1 insertion(+), 0 deletions(-)\n[master 79f9008] fourth\n Author: A U Thor <author@example.com>\n 1 file changed, 1 insertion(+), 0 deletions(-)\nok 10 - cherry-pick --stdin works\n\n# failed 2 among 10 test(s)\n1..10\n\n-- \nDuy\n"},{"id":"172515","messageId":"CAGdFq_iwEvD_-hD63KeF45WuRhWrK6JuWWqzDpjHcZ+0gHDaqg@mail.gmail.com","threadId":"27974","inReplyTo":"4E362F8E.1050105@gmail.com","subject":"Re: [PATCH] For Real - Fixed pluralization in diff reports","fromName":"Sverre Rabbelier","fromEmail":"srabbelier@gmail.com","sentAt":"2011-08-01T09:58:48Z","receivedAt":"2011-08-01T09:58:48Z","isPatch":true,"sender":{"key":"srabbelier@gmail.com","avatar":"https://avatars.githubusercontent.com/u/3098?v=4"},"body":"Heya,\n\nOn Mon, Aug 1, 2011 at 06:46, Jon Forrest <nobozo@gmail.com> wrote:\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\", adds, adds == 1 ?\n> \"\" : \"s\", dels,\n> +               dels == 1 ? \"\" : \"s\");\n>  }\n\nAlso, this is rather detrimental to the i18n effort methinks?\n\n-- \nCheers,\n\nSverre Rabbelier\n"},{"id":"172533","messageId":"4E36B8E4.5080900@gmail.com","threadId":"27974","inReplyTo":"CAGdFq_iwEvD_-hD63KeF45WuRhWrK6JuWWqzDpjHcZ+0gHDaqg@mail.gmail.com","subject":"Re: [PATCH] For Real - Fixed pluralization in diff reports","fromName":"Jon Forrest","fromEmail":"nobozo@gmail.com","sentAt":"2011-08-01T14:32:04Z","receivedAt":"2011-08-01T14:32:04Z","isPatch":true,"sender":{"key":"nobozo@gmail.com","avatar":"https://gravatar.com/avatar/37c6a7b57f29b3f35c6a9016537907c52f15bbf98575617dc046bcec6bf06372?d=mp&s=160"},"body":"On 8/1/2011 2:58 AM, Sverre Rabbelier wrote:\n> Heya,\n>\n> On Mon, Aug 1, 2011 at 06:46, Jon Forrest<nobozo@gmail.com>  wrote:\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\", adds, adds == 1 ?\n>> \"\" : \"s\", dels,\n>> +               dels == 1 ? \"\" : \"s\");\n>>   }\n>\n> Also, this is rather detrimental to the i18n effort methinks?\n\nIf the goal if the i18n effort is also to produce grammatically\ncorrect output in all the supported languages then the\ntests that my patch would break would have to be rewritten\nanyway.\n\nJon\n"},{"id":"172559","messageId":"20110801180603.GB10636@sigill.intra.peff.net","threadId":"27974","inReplyTo":"4E36B8E4.5080900@gmail.com","subject":"Re: [PATCH] For Real - Fixed pluralization in diff reports","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2011-08-01T18:06:03Z","receivedAt":"2011-08-01T18:06:03Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Aug 01, 2011 at 07:32:04AM -0700, Jon Forrest wrote:\n\n> On 8/1/2011 2:58 AM, Sverre Rabbelier wrote:\n> >Heya,\n> >\n> >On Mon, Aug 1, 2011 at 06:46, Jon Forrest<nobozo@gmail.com>  wrote:\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\", adds, adds == 1 ?\n> >>\"\" : \"s\", dels,\n> >>+               dels == 1 ? \"\" : \"s\");\n> >>  }\n> >\n> >Also, this is rather detrimental to the i18n effort methinks?\n> \n> If the goal if the i18n effort is also to produce grammatically\n> correct output in all the supported languages then the\n> tests that my patch would break would have to be rewritten\n> anyway.\n\nI think he means that auto-pluralization like this cannot be done in an\ni18n world, as many languages do not simply add \"s\". Your patch would\nhave to use ngettext, something like this (totally untested and just\ncopying a similar spot in suggest_reattach, as I have never done any\ni18n myself):\n\n  fprintf(options->file,\n    Q_(\" %d file changed,\",\n       \" %d files changed\",\n       total_files),\n    Q_(\" %d insertion(+)\",\n       \" %d insertions(+)\",\n       adds),\n    Q_(\" %d deletion(-)\",\n       \" %d deletions(-)\",\n       dels),\n    \"\\n\",\n    total_files, adds, dels);\n\nAnd that gives translators a chance to specify the entire singular and\nplural versions separately.\n\n-Peff\n"},{"id":"172583","messageId":"4E36F025.9040100@gmail.com","threadId":"27974","inReplyTo":"20110801180603.GB10636@sigill.intra.peff.net","subject":"Re: [PATCH] For Real - Fixed pluralization in diff reports","fromName":"Jon Forrest","fromEmail":"nobozo@gmail.com","sentAt":"2011-08-01T18:27:49Z","receivedAt":"2011-08-01T18:27:49Z","isPatch":true,"sender":{"key":"nobozo@gmail.com","avatar":"https://gravatar.com/avatar/37c6a7b57f29b3f35c6a9016537907c52f15bbf98575617dc046bcec6bf06372?d=mp&s=160"},"body":"On 8/1/2011 11:06 AM, Jeff King wrote:\n>\n> I think he means that auto-pluralization like this cannot be done in an\n> i18n world, as many languages do not simply add \"s\". Your patch would\n> have to use ngettext, something like this (totally untested and just\n> copying a similar spot in suggest_reattach, as I have never done any\n> i18n myself):\n\n[snip]\n\n> And that gives translators a chance to specify the entire singular and\n> plural versions separately.\n\nI entirely agree. My point is only that the various tests\nthat expect the current behavior will have to be changed\nwhether the implementation of correct plurals uses my\ninferior method or the way more correct i18n method.\n\nJon\n"},{"id":"172587","messageId":"CAGdFq_j0Hr4LMaFC3irS8rhv2N0ePz_t8xpNTDCA-arC-E2UDA@mail.gmail.com","threadId":"27974","inReplyTo":"4E36F025.9040100@gmail.com","subject":"Re: [PATCH] For Real - Fixed pluralization in diff reports","fromName":"Sverre Rabbelier","fromEmail":"srabbelier@gmail.com","sentAt":"2011-08-01T18:32:51Z","receivedAt":"2011-08-01T18:32:51Z","isPatch":true,"sender":{"key":"srabbelier@gmail.com","avatar":"https://avatars.githubusercontent.com/u/3098?v=4"},"body":"Heya,\n\nOn Mon, Aug 1, 2011 at 20:27, Jon Forrest <nobozo@gmail.com> wrote:\n> I entirely agree. My point is only that the various tests\n> that expect the current behavior will have to be changed\n> whether the implementation of correct plurals uses my\n> inferior method or the way more correct i18n method.\n\nWouldn't it be a nice hack if we just solved problem through i18n\nthen? Have all the plumbing see the current wording, but through i18n\nchange it to something grammatically correct for the porcelain.\nProbably not possible, but a nice daydream :).\n\n-- \nCheers,\n\nSverre Rabbelier\n"},{"id":"172589","messageId":"20110801183812.GA16438@sigill.intra.peff.net","threadId":"27974","inReplyTo":"CAGdFq_j0Hr4LMaFC3irS8rhv2N0ePz_t8xpNTDCA-arC-E2UDA@mail.gmail.com","subject":"Re: [PATCH] For Real - Fixed pluralization in diff reports","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2011-08-01T18:38:12Z","receivedAt":"2011-08-01T18:38:12Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Aug 01, 2011 at 08:32:51PM +0200, Sverre Rabbelier wrote:\n\n> On Mon, Aug 1, 2011 at 20:27, Jon Forrest <nobozo@gmail.com> wrote:\n> > I entirely agree. My point is only that the various tests\n> > that expect the current behavior will have to be changed\n> > whether the implementation of correct plurals uses my\n> > inferior method or the way more correct i18n method.\n> \n> Wouldn't it be a nice hack if we just solved problem through i18n\n> then? Have all the plumbing see the current wording, but through i18n\n> change it to something grammatically correct for the porcelain.\n> Probably not possible, but a nice daydream :).\n\nI thought there was still some question of whether this text was\nsomething that should be script-parseable. If it is, then it shouldn't\nbe i18n'd at all, nor should we lightly change the format with\npluralization magic. And if it isn't, then we should definitely go the\nfull i18n route. So in either case, the original patch isn't\nappropriate.\n\nI don't have a strong opinion myself. I tend to lean towards i18n-ing\nit, because any scripts should be using --numstat to parse, anyway.\nOTOH, as Junio pointed out, we are matching the output of much older\ntools, so pre-git scripts might be written to read the --stat format.\nI've never seen such a script, and I have no idea how many there really\nare.\n\n-Peff\n"},{"id":"172762","messageId":"m3livdqh9h.fsf@localhost.localdomain","threadId":"27974","inReplyTo":"4E36B8E4.5080900@gmail.com","subject":"Re: [PATCH] For Real - Fixed pluralization in diff reports","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2011-08-03T13:38:43Z","receivedAt":"2011-08-03T13:38:43Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Jon Forrest <nobozo@gmail.com> writes:\n> On 8/1/2011 2:58 AM, Sverre Rabbelier wrote:\n>> On Mon, Aug 1, 2011 at 06:46, Jon Forrest<nobozo@gmail.com>  wrote:\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\", adds, adds == 1 ?\n>>> \"\" : \"s\", dels,\n>>> +               dels == 1 ? \"\" : \"s\");\n>>>   }\n>>\n>> Also, this is rather detrimental to the i18n effort methinks?\n\nBesides, as it was already said, this is an API.\n \n> If the goal if the i18n effort is also to produce grammatically\n> correct output in all the supported languages then the\n> tests that my patch would break would have to be rewritten\n> anyway.\n\nThat's not it.\n\nThe problem is that above code assumes that plural form can be formed\nby adding suffix, and it assumes that is only one plural form... both\nassumptions does not hold for non-English.\n\nC.f. \"Additional functions for plural forms\" chapter in gettext info\npage: http://www.gnu.org/s/hello/manual/gettext/Plural-forms.html\n\n-- \nJakub Narębski\n"},{"id":"172780","messageId":"4E397CE9.2070500@gmail.com","threadId":"27974","inReplyTo":"m3livdqh9h.fsf@localhost.localdomain","subject":"Re: [PATCH] For Real - Fixed pluralization in diff reports","fromName":"Jon Forrest","fromEmail":"nobozo@gmail.com","sentAt":"2011-08-03T16:52:57Z","receivedAt":"2011-08-03T16:52:57Z","isPatch":true,"sender":{"key":"nobozo@gmail.com","avatar":"https://gravatar.com/avatar/37c6a7b57f29b3f35c6a9016537907c52f15bbf98575617dc046bcec6bf06372?d=mp&s=160"},"body":"On 8/3/2011 6:38 AM, Jakub Narebski wrote:\n> Jon Forrest<nobozo@gmail.com>  writes:\n\n> Besides, as it was already said, this is an API.\n\nI pretty much only looked at that one file and it\ndidn't look at quick glance like an API was being\nused to internationalize git.\n\n>> If the goal if the i18n effort is also to produce grammatically\n>> correct output in all the supported languages then the\n>> tests that my patch would break would have to be rewritten\n>> anyway.\n>\n> That's not it.\n\nWe can discuss the correct way to implement a change like this\nbut the fact remains that whatever the implementation, the issue\nthat Junio raised will remain. That is, what to do about all\nthe places that presume the old incorrect output.\n\nThis problem isn't specific to git. I can easily imagine\nother open source projects that face, or will face, this\nproblem.\n\nJon\n"}]}