{"thread":{"id":"29489","subject":"[PATCH] Correct singular form in diff summary line for human interaction","startedAt":"2012-01-31T14:24:00Z","lastAt":"2012-03-13T06:13:43Z","messageCount":32,"participants":["Nguyễn Thái Ngọc Duy","Jonathan Nieder","Junio C Hamano","Nguyen Thai Ngoc Duy","Thomas Dickey","Jeff King"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"183413","messageId":"1328019840-6168-1-git-send-email-pclouds@gmail.com","threadId":"29489","inReplyTo":null,"subject":"[PATCH] Correct singular form in diff summary line for human interaction","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2012-01-31T14:24:00Z","receivedAt":"2012-01-31T14:24:00Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"\"git diff --stat\" and \"git apply --stat\" now learn to print the line\n\"%d files changed, %d insertions(+), %d deletions(-)\" in singular form\nwhenever applicable.\n\nThis change uncondtionally would upset scripts because scripts are not\nnice. They simply hate changes. They can be very hostile when that\nhappens. So only adjust the line for human consumption.\n\nConvenient function interactive_use() is added for this purpose. The\ncommand thinks it's in human hands when:\n\n - GIT_SCRIPTING environment variable is not set\n - pager is on or\n - both stdout and stderr point to tty device\n\nSigned-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n The third attempt in the last couple months to remove three \"s\" in\n one line. I did not upset the test suite with this and hopefully\n won't upset any scripts around. Good start?\n\n builtin/apply.c |    3 ++-\n cache.h         |    1 +\n diff.c          |   33 ++++++++++++++++++++++++++++-----\n diff.h          |    3 +++\n pager.c         |    7 +++++++\n 5 files changed, 41 insertions(+), 6 deletions(-)\n\ndiff --git a/builtin/apply.c b/builtin/apply.c\nindex c24dc54..389898f 100644\n--- a/builtin/apply.c\n+++ b/builtin/apply.c\n@@ -14,6 +14,7 @@\n #include \"builtin.h\"\n #include \"string-list.h\"\n #include \"dir.h\"\n+#include \"diff.h\"\n #include \"parse-options.h\"\n \n /*\n@@ -3241,7 +3242,7 @@ static void stat_patch_list(struct patch *patch)\n \t\tshow_stats(patch);\n \t}\n \n-\tprintf(\" %d files changed, %d insertions(+), %d deletions(-)\\n\", files, adds, dels);\n+\tprint_stat_summary(stdout, files, adds, dels);\n }\n \n static void numstat_patch_list(struct patch *patch)\ndiff --git a/cache.h b/cache.h\nindex 10afd71..7e0bb2b 100644\n--- a/cache.h\n+++ b/cache.h\n@@ -1175,6 +1175,7 @@ extern void setup_pager(void);\n extern const char *pager_program;\n extern int pager_in_use(void);\n extern int pager_use_color;\n+extern int interactive_use(void);\n \n extern const char *editor_program;\n extern const char *askpass_program;\ndiff --git a/diff.c b/diff.c\nindex 7e15426..2d63e9c 100644\n--- a/diff.c\n+++ b/diff.c\n@@ -1322,6 +1322,32 @@ static void fill_print_name(struct diffstat_file *file)\n \tfile->print_name = pname;\n }\n \n+int print_stat_summary(FILE *fp, int files, int insertions, int deletions)\n+{\n+\tstruct strbuf sb = STRBUF_INIT;\n+\tint ret;\n+\n+\tif (!interactive_use())\n+\t\treturn fprintf(fp, \" %d files changed, %d insertions(+), %d deletions(-)\\n\",\n+\t\t\t       files, insertions, deletions);\n+\n+\tstrbuf_addf(&sb,\n+\t\t    ngettext(\" %d file changed,\", \" %d files changed,\",\n+\t\t\t     files),\n+\t\t    files);\n+\tstrbuf_addf(&sb,\n+\t\t    ngettext(\" %d insertion(+),\", \" %d insertions(+),\",\n+\t\t\t     insertions),\n+\t\t    insertions);\n+\tstrbuf_addf(&sb,\n+\t\t    ngettext(\" %d deletion(-)\\n\", \" %d deletions(-)\\n\",\n+\t\t\t     deletions),\n+\t\t    deletions);\n+\tret = fputs(sb.buf, fp);\n+\tstrbuf_release(&sb);\n+\treturn ret;\n+}\n+\n static void show_stats(struct diffstat_t *data, struct diff_options *options)\n {\n \tint i, len, add, del, adds = 0, dels = 0;\n@@ -1475,9 +1501,7 @@ static void show_stats(struct diffstat_t *data, struct diff_options *options)\n \t\textra_shown = 1;\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+\tprint_stat_summary(options->file, total_files, adds, dels);\n }\n \n static void show_shortstats(struct diffstat_t *data, struct diff_options *options)\n@@ -1507,8 +1531,7 @@ static void show_shortstats(struct diffstat_t *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 deletions(-)\\n\",\n-\t       total_files, adds, dels);\n+\tprint_stat_summary(options->file, total_files, adds, dels);\n }\n \n static void show_numstat(struct diffstat_t *data, struct diff_options *options)\ndiff --git a/diff.h b/diff.h\nindex ae71f4c..7af5f1e 100644\n--- a/diff.h\n+++ b/diff.h\n@@ -324,4 +324,7 @@ extern struct userdiff_driver *get_textconv(struct diff_filespec *one);\n \n extern int parse_rename_score(const char **cp_p);\n \n+extern int print_stat_summary(FILE *fp, int files,\n+\t\t\t      int insertions, int deletions);\n+\n #endif /* DIFF_H */\ndiff --git a/pager.c b/pager.c\nindex 975955b..9a3d3d8 100644\n--- a/pager.c\n+++ b/pager.c\n@@ -110,3 +110,10 @@ int pager_in_use(void)\n \tenv = getenv(\"GIT_PAGER_IN_USE\");\n \treturn env ? git_config_bool(\"GIT_PAGER_IN_USE\", env) : 0;\n }\n+\n+int interactive_use(void)\n+{\n+\tconst char *env;\n+\tenv = getenv(\"GIT_SCRIPTING\");\n+\treturn !env && (pager_in_use() || (isatty(1) && isatty(2)));\n+}\n-- \n1.7.8.36.g69ee2\n"},{"id":"183417","messageId":"20120131152028.GA10717@burratino","threadId":"29489","inReplyTo":"1328019840-6168-1-git-send-email-pclouds@gmail.com","subject":"Re: [PATCH] Correct singular form in diff summary line for human interaction","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2012-01-31T15:20:28Z","receivedAt":"2012-01-31T15:20:28Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Hi,\n\nNguyễn Thái Ngọc Duy wrote:\n\n> Convenient function interactive_use() is added for this purpose. The\n> command thinks it's in human hands when:\n\nI admit I really dislike this, especially:\n\n>  - GIT_SCRIPTING environment variable is not set\n\nIf my GUI app was parsing diffstats to convert them into a visual\nrepresentation, as a novice it may not be obvious to me where to find\nthe menu entry file to set this envvar in.\n\nBut maybe I'm not the right person to ask, since I'd be okay with\nremoving the \"s\"es (with an appropriate incubation time to discover\nwhether we are introducing a regression) unconditionally.\n\nIf there is an environment variable to say \"I don't want to see\nvariations on strings intended for humans\", can it be spelled as\nLC_ALL=C?\n\nJust my two cents,\nJonathan\n"},{"id":"183421","messageId":"7vvcnr92y0.fsf@alter.siamese.dyndns.org","threadId":"29489","inReplyTo":"20120131152028.GA10717@burratino","subject":"Re: [PATCH] Correct singular form in diff summary line for human interaction","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-01-31T17:50:15Z","receivedAt":"2012-01-31T17:50:15Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jonathan Nieder <jrnieder@gmail.com> writes:\n\n> Nguyễn Thái Ngọc Duy wrote:\n>\n>> Convenient function interactive_use() is added for this purpose. The\n>> command thinks it's in human hands when:\n>\n> I admit I really dislike this, especially:\n>\n>>  - GIT_SCRIPTING environment variable is not set\n\nI would have to agree that it is horrible.\n\n> But maybe I'm not the right person to ask, since I'd be okay with\n> removing the \"s\"es (with an appropriate incubation time to discover\n> whether we are introducing a regression) unconditionally.\n>\n> If there is an environment variable to say \"I don't want to see\n> variations on strings intended for humans\", can it be spelled as\n> LC_ALL=C?\n\nI have been wondering if we should even care, for two reasons.\n\n * We have had --numstat forever which is exactly what we added for scripts'\n   use. \"I've been parsing that output meant for humans\" is not an excuse.\n\n * 'diffstat', at least the recent versions of it (it is hard to track\n   down historical versions and I gave up [*1*]), gives output like these:\n\n        1 file changed, 1 insertion(+)\n\t2 files changed, 3 insertions(+), 1 deletion(-)\n\t0 files changed\n\n   The first one does not have anything but a one-line addition to a file,\n   and we do not even see \"0 deletions(-)\". The second one is a more\n   typical example. The third one is \"diffstat </dev/null\" [*2*].\n\nIf we were to touch this, I would prefer to do so unconditionally without\n\"hrm, can we reliably guess this is meant for humans?\" and release it\nunceremoniously, perhaps as part of the next release that will have a much\nbigger user-visible UI correction to 'merge'.\n\n\n[Footnote]\n\n*1* I can guess from http://invisible-island.net/diffstat/CHANGES that the\nsource is probably kept in RCS, but I couldn't find development histories\nbeyond what is in that file.\n\n*2* We mistakenly applied a patch to make \"git apply --stat </dev/null\" to\nerror out recently, which we might want to fix. But that is a separate\ntopic.\n"},{"id":"183451","messageId":"CACsJy8Dd4_Pnvzxww38EfZt8NgRow+qxCReohc45XoNpfJCbYg@mail.gmail.com","threadId":"29489","inReplyTo":"7vvcnr92y0.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] Correct singular form in diff summary line for human interaction","fromName":"Nguyen Thai Ngoc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2012-02-01T01:32:43Z","receivedAt":"2012-02-01T01:32:43Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Wed, Feb 1, 2012 at 12:50 AM, Junio C Hamano <gitster@pobox.com> wrote:\n>> If there is an environment variable to say \"I don't want to see\n>> variations on strings intended for humans\", can it be spelled as\n>> LC_ALL=C?\n>\n>  ...\n>\n> If we were to touch this, I would prefer to do so unconditionally without\n> \"hrm, can we reliably guess this is meant for humans?\" and release it\n> unceremoniously, perhaps as part of the next release that will have a much\n> bigger user-visible UI correction to 'merge'.\n\nUnconditionally change is fine to me. There's another implication\nthat's not mentioned in the commit message, this change also allows\nnon-English translations. Any objections on i18n or we just keep this\nline English only? Personally if scripts do not matter any more, I see\nno reasons this line cannot be translated.\n-- \nDuy\n"},{"id":"183452","messageId":"20120201014515.GA24402@debian50-32.invisible-island.net","threadId":"29489","inReplyTo":"CACsJy8Dd4_Pnvzxww38EfZt8NgRow+qxCReohc45XoNpfJCbYg@mail.gmail.com","subject":"Re: [PATCH] Correct singular form in diff summary line for human interaction","fromName":"Thomas Dickey","fromEmail":"dickey@his.com","sentAt":"2012-02-01T01:45:15Z","receivedAt":"2012-02-01T01:45:15Z","isPatch":true,"sender":{"key":"dickey@his.com","avatar":null},"body":"On Wed, Feb 01, 2012 at 08:32:43AM +0700, Nguyen Thai Ngoc Duy wrote:\n> On Wed, Feb 1, 2012 at 12:50 AM, Junio C Hamano <gitster@pobox.com> wrote:\n> >> If there is an environment variable to say \"I don't want to see\n> >> variations on strings intended for humans\", can it be spelled as\n> >> LC_ALL=C?\n\nI assume from Neider on the list that this is related to mawk, but I don't\nhave the email preceding this...\n\n-- \nThomas E. Dickey <dickey@invisible-island.net>\nhttp://invisible-island.net\nftp://invisible-island.net\n"},{"id":"183453","messageId":"20120201015606.GA24482@debian50-32.invisible-island.net","threadId":"29489","inReplyTo":"CACsJy8Dd4_Pnvzxww38EfZt8NgRow+qxCReohc45XoNpfJCbYg@mail.gmail.com","subject":"Re: [PATCH] Correct singular form in diff summary line for human interaction","fromName":"Thomas Dickey","fromEmail":"dickey@his.com","sentAt":"2012-02-01T01:56:06Z","receivedAt":"2012-02-01T01:56:06Z","isPatch":true,"sender":{"key":"dickey@his.com","avatar":null},"body":"On Wed, Feb 01, 2012 at 08:32:43AM +0700, Nguyen Thai Ngoc Duy wrote:\n> On Wed, Feb 1, 2012 at 12:50 AM, Junio C Hamano <gitster@pobox.com> wrote:\n> >> If there is an environment variable to say \"I don't want to see\n> >> variations on strings intended for humans\", can it be spelled as\n> >> LC_ALL=C?\n> >\n> >  ...\n\n... diffstat (google helped find context)\n\n> > If we were to touch this, I would prefer to do so unconditionally without\n> > \"hrm, can we reliably guess this is meant for humans?\" and release it\n> > unceremoniously, perhaps as part of the next release that will have a much\n> > bigger user-visible UI correction to 'merge'.\n> \n> Unconditionally change is fine to me. There's another implication\n> that's not mentioned in the commit message, this change also allows\n> non-English translations. Any objections on i18n or we just keep this\n> line English only? Personally if scripts do not matter any more, I see\n> no reasons this line cannot be translated.\n\nI seem to recall that gettext does support plurals...\n\nHowever, going that route means that even innocuous things like the\nparentheses \"(+)\" can be mangled by translators (guaranteed to break\nscripts ;-)\n\n-- \nThomas E. Dickey <dickey@invisible-island.net>\nhttp://invisible-island.net\nftp://invisible-island.net\n"},{"id":"183454","messageId":"CACsJy8DMkdsJ2ZmyyLVSUHyWj=qw6pkBB9CXQARfmZeQ_=YaNQ@mail.gmail.com","threadId":"29489","inReplyTo":"20120201015606.GA24482@debian50-32.invisible-island.net","subject":"Re: [PATCH] Correct singular form in diff summary line for human interaction","fromName":"Nguyen Thai Ngoc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2012-02-01T02:37:57Z","receivedAt":"2012-02-01T02:37:57Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Wed, Feb 1, 2012 at 8:56 AM, Thomas Dickey <dickey@his.com> wrote:\n>> > If we were to touch this, I would prefer to do so unconditionally without\n>> > \"hrm, can we reliably guess this is meant for humans?\" and release it\n>> > unceremoniously, perhaps as part of the next release that will have a much\n>> > bigger user-visible UI correction to 'merge'.\n>>\n>> Unconditionally change is fine to me. There's another implication\n>> that's not mentioned in the commit message, this change also allows\n>> non-English translations. Any objections on i18n or we just keep this\n>> line English only? Personally if scripts do not matter any more, I see\n>> no reasons this line cannot be translated.\n>\n> I seem to recall that gettext does support plurals...\n>\n> However, going that route means that even innocuous things like the\n> parentheses \"(+)\" can be mangled by translators (guaranteed to break\n> scripts ;-)\n\nWe disregard scripts at this point already, I think. \"+\" and \"-\"\nshould not be translated. We could either leave them out of\ntranslatable text, or put a note to translators saying not to\ntranslate them.\n-- \nDuy\n"},{"id":"183457","messageId":"7vk4475k5s.fsf@alter.siamese.dyndns.org","threadId":"29489","inReplyTo":"20120201015606.GA24482@debian50-32.invisible-island.net","subject":"Re: [PATCH] Correct singular form in diff summary line for human interaction","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-02-01T03:04:15Z","receivedAt":"2012-02-01T03:04:15Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thomas Dickey <dickey@his.com> writes:\n\n> On Wed, Feb 01, 2012 at 08:32:43AM +0700, Nguyen Thai Ngoc Duy wrote:\n>> On Wed, Feb 1, 2012 at 12:50 AM, Junio C Hamano <gitster@pobox.com> wrote:\n>> >> If there is an environment variable to say \"I don't want to see\n>> >> variations on strings intended for humans\", can it be spelled as\n>> >> LC_ALL=C?\n>> >\n>> >  ...\n>\n> ... diffstat (google helped find context)\n\nWhen we show diffstat from \"git diff --stat\" (or \"git apply --stat\"), we\ncurrently do not do any singular/plural on the last line of the output\nthat summarizes the graph, ending up with:\n\n\t1 files changed, 1 insertions(+), 0 deletions(-)\n\nwhen there is a single line insertion to a file and nothing else.\n\nMy recollection is that our behaviour originally came from our desire to\nbe as close as what \"diffstat\" produces, but that does not seem to be the\ncase.  I observed that the output from recent versions of \"diffstat\" is\nmuch more human friendly.  We get these, depending on the input, from\n\"diffstat\" version 1.53:\n\n        1 file changed, 1 insertion(+)\n        1 file changed, 1 deletion(-)\n\t0 files changed\n\t2 files changed, 3 insertions(+), 1 deletion(-)\n\nNamely, it does singular/plural correctly, and omits unnecessary \"0\ndeletions(-)\" and \"0 insertions(+)\".\n\nI was wondering if you remember what the behaviour of older versions of\n\"diffstat\" was, and if it was changed to be more human friendly over\ntime. It is very possible that I am misremembering this and \"diffstat\" has\nalways done the singular/plural correctly and omitted useless \"0 lines\".\n\nSomehow it seems hard to get hold of older versions of \"diffstat\", and I\nwas hoping that I could get that information straight out of the current\nmaintainer.\n\nThanks for responding and sorry for the lack of context of the original\nmessage.\n"},{"id":"183465","messageId":"20120201094006.GA3989@debian50-32.invisible-island.net","threadId":"29489","inReplyTo":"7vk4475k5s.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] Correct singular form in diff summary line for human interaction","fromName":"Thomas Dickey","fromEmail":"dickey@his.com","sentAt":"2012-02-01T09:40:06Z","receivedAt":"2012-02-01T09:40:06Z","isPatch":true,"sender":{"key":"dickey@his.com","avatar":null},"body":"On Tue, Jan 31, 2012 at 07:04:15PM -0800, Junio C Hamano wrote:\n> Thomas Dickey <dickey@his.com> writes:\n> \n> > On Wed, Feb 01, 2012 at 08:32:43AM +0700, Nguyen Thai Ngoc Duy wrote:\n> >> On Wed, Feb 1, 2012 at 12:50 AM, Junio C Hamano <gitster@pobox.com> wrote:\n> >> >> If there is an environment variable to say \"I don't want to see\n> >> >> variations on strings intended for humans\", can it be spelled as\n> >> >> LC_ALL=C?\n> >> >\n> >> >  ...\n> >\n> > ... diffstat (google helped find context)\n> \n> When we show diffstat from \"git diff --stat\" (or \"git apply --stat\"), we\n> currently do not do any singular/plural on the last line of the output\n> that summarizes the graph, ending up with:\n> \n> \t1 files changed, 1 insertions(+), 0 deletions(-)\n> \n> when there is a single line insertion to a file and nothing else.\n> \n> My recollection is that our behaviour originally came from our desire to\n> be as close as what \"diffstat\" produces, but that does not seem to be the\n> case.  I observed that the output from recent versions of \"diffstat\" is\n> much more human friendly.  We get these, depending on the input, from\n> \"diffstat\" version 1.53:\n\nI added the PLURAL() macro in 1.22, in 1996/3/16, which was a few months\nbefore Tony Nugent commented that it was being used by other people.  Since\nI'd been sending patches with diffstat's since mid-1994, it's possible\nthat there were a few copies using the form without plurals.  But it's\nbeen quite a while.  Also, it was in 1998/1/17 that I modified the\ncopyright notice (1.26) at the request of someone in the Linux group, so\nI'd assume that they would have started using the newer version.\n\nExcept for later applying PLURAL to the number of files changed (which Jean\nDelvare pointed out in 2005), the message construction has not changed since\nthen.  The insert/delete/modify parts of the message were optional as you see in\nmy earliest version (1.3) from 1993/10/23:\n\n\tprintf(\"%d files changed\", num_files);\n\tif (total_ins) printf(\", %d insertions\", total_ins);\n\tif (total_del) printf(\", %d deletions\", total_del);\n\tif (total_mod) printf(\", %d modifications\", total_mod);\n\tprintf(\"\\n\");\n \n>         1 file changed, 1 insertion(+)\n>         1 file changed, 1 deletion(-)\n> \t0 files changed\n> \t2 files changed, 3 insertions(+), 1 deletion(-)\n> \n> Namely, it does singular/plural correctly, and omits unnecessary \"0\n> deletions(-)\" and \"0 insertions(+)\".\n> \n> I was wondering if you remember what the behaviour of older versions of\n> \"diffstat\" was, and if it was changed to be more human friendly over\n> time. It is very possible that I am misremembering this and \"diffstat\" has\n> always done the singular/plural correctly and omitted useless \"0 lines\".\n\nI have back to 1.3 in my archive. I use rcshist to look for things like this.\n(also, for small things like this, I have a script that pulls all versions,\nwith proper timestamps to make it simpler to sort the files by date).\n \n> Somehow it seems hard to get hold of older versions of \"diffstat\", and I\n> was hoping that I could get that information straight out of the current\n> maintainer.\n\nI can provide the information.\n\nActually a couple of weeks ago I was experimenting with rcs-fast-export, but\nfound that would need more work to export diffstat (I use branches a lot)\nI'm using \"conflict\" as a test-case for the changes that I'm making to support\nexporting mawk.\n\n> Thanks for responding and sorry for the lack of context of the original\n> message.\n\nno problem - google was helpful ;-)\n\n-- \nThomas E. Dickey <dickey@invisible-island.net>\nhttp://invisible-island.net\nftp://invisible-island.net\n"},{"id":"183469","messageId":"1328100907-20397-1-git-send-email-pclouds@gmail.com","threadId":"29489","inReplyTo":"1328019840-6168-1-git-send-email-pclouds@gmail.com","subject":"[PATCH v2] Use correct grammar in diffstat summary line","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2012-02-01T12:55:07Z","receivedAt":"2012-02-01T12:55:07Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"\"git diff --stat\" and \"git apply --stat\" now learn to print the line\n\"%d files changed, %d insertions(+), %d deletions(-)\" in singular form\nwhenever applicable. \"0 insertions\" and \"0 deletions\" are also omitted\nunless they are both zero.\n\nAlso make this line translatable.\n\nSigned-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Second try. Make it unconditionally (I'd still rather have no changes\n when LANG=C). Also omit \"0 operations\", although I keep \"%d files\n changed, 0 insertions(+), 0 deletions(-)\" for binary diff.\n\n In Vietnamese, the summary line is \"thay đổi 68 tập tin, thêm(+) 163,\n xoá(-) 116\". Lovely. Perhaps I'll translate git into Vietnamese after\n all :)\n\n And this patch's diffstat looks just scary due to test suite's updates.\n\n builtin/apply.c                                    |    3 +-\n diff.c                                             |   53 ++++++++++++++++++--\n diff.h                                             |    3 +\n t/t0023-crlf-am.sh                                 |    2 +-\n t/t1200-tutorial.sh                                |    2 +-\n t/t3300-funny-names.sh                             |    2 +-\n t/t3508-cherry-pick-many-commits.sh                |   12 ++--\n t/t3903-stash.sh                                   |    4 +-\n ...ff-tree_--cc_--patch-with-stat_--summary_master |    2 +-\n ...diff-tree_--cc_--patch-with-stat_--summary_side |    2 +-\n .../diff.diff-tree_--cc_--patch-with-stat_master   |    2 +-\n .../diff.diff-tree_--cc_--stat_--summary_master    |    2 +-\n t/t4013/diff.diff-tree_--cc_--stat_--summary_side  |    2 +-\n t/t4013/diff.diff-tree_--cc_--stat_master          |    2 +-\n ...pretty=oneline_--root_--patch-with-stat_initial |    2 +-\n .../diff.diff-tree_--pretty_--patch-with-stat_side |    2 +-\n ...-tree_--pretty_--root_--patch-with-stat_initial |    2 +-\n ...f-tree_--pretty_--root_--stat_--summary_initial |    2 +-\n .../diff.diff-tree_--pretty_--root_--stat_initial  |    2 +-\n ...diff.diff-tree_--root_--patch-with-stat_initial |    2 +-\n t/t4013/diff.diff-tree_-c_--stat_--summary_master  |    2 +-\n t/t4013/diff.diff-tree_-c_--stat_--summary_side    |    2 +-\n t/t4013/diff.diff-tree_-c_--stat_master            |    2 +-\n .../diff.diff_--patch-with-stat_-r_initial..side   |    2 +-\n t/t4013/diff.diff_--patch-with-stat_initial..side  |    2 +-\n t/t4013/diff.diff_--stat_initial..side             |    2 +-\n t/t4013/diff.diff_-r_--stat_initial..side          |    2 +-\n ..._--attach_--stdout_--suffix=.diff_initial..side |    2 +-\n ....format-patch_--attach_--stdout_initial..master |    4 +-\n ...format-patch_--attach_--stdout_initial..master^ |    2 +-\n ...ff.format-patch_--attach_--stdout_initial..side |    2 +-\n ...nline_--stdout_--numbered-files_initial..master |    4 +-\n ...tdout_--subject-prefix=TESTCASE_initial..master |    4 +-\n ....format-patch_--inline_--stdout_initial..master |    4 +-\n ...format-patch_--inline_--stdout_initial..master^ |    2 +-\n ...ff.format-patch_--inline_--stdout_initial..side |    2 +-\n ...tch_--stdout_--cover-letter_-n_initial..master^ |    2 +-\n ...at-patch_--stdout_--no-numbered_initial..master |    4 +-\n ...ormat-patch_--stdout_--numbered_initial..master |    4 +-\n t/t4013/diff.format-patch_--stdout_initial..master |    4 +-\n .../diff.format-patch_--stdout_initial..master^    |    2 +-\n t/t4013/diff.format-patch_--stdout_initial..side   |    2 +-\n ....log_--patch-with-stat_--summary_master_--_dir_ |    6 +-\n t/t4013/diff.log_--patch-with-stat_master          |    4 +-\n t/t4013/diff.log_--patch-with-stat_master_--_dir_  |    6 +-\n ..._--root_--cc_--patch-with-stat_--summary_master |    8 ++--\n ...f.log_--root_--patch-with-stat_--summary_master |    6 +-\n t/t4013/diff.log_--root_--patch-with-stat_master   |    6 +-\n ...og_--root_-c_--patch-with-stat_--summary_master |    8 ++--\n t/t4013/diff.show_--patch-with-stat_--summary_side |    2 +-\n t/t4013/diff.show_--patch-with-stat_side           |    2 +-\n t/t4013/diff.show_--stat_--summary_side            |    2 +-\n t/t4013/diff.show_--stat_side                      |    2 +-\n ...nged_--patch-with-stat_--summary_master_--_dir_ |    6 +-\n t/t4013/diff.whatchanged_--patch-with-stat_master  |    4 +-\n ...ff.whatchanged_--patch-with-stat_master_--_dir_ |    6 +-\n ..._--root_--cc_--patch-with-stat_--summary_master |    8 ++--\n ...anged_--root_--patch-with-stat_--summary_master |    6 +-\n ...iff.whatchanged_--root_--patch-with-stat_master |    6 +-\n ...ed_--root_-c_--patch-with-stat_--summary_master |    8 ++--\n t/t4014-format-patch.sh                            |    2 +-\n t/t4030-diff-textconv.sh                           |    2 +-\n t/t4045-diff-relative.sh                           |    2 +-\n t/t4049-diff-stat-count.sh                         |    2 +-\n t/t4100/t-apply-8.expect                           |    2 +-\n t/t4100/t-apply-9.expect                           |    2 +-\n t/t5150-request-pull.sh                            |    2 +-\n t/t7602-merge-octopus-many.sh                      |    6 +-\n 68 files changed, 163 insertions(+), 116 deletions(-)\n\ndiff --git a/builtin/apply.c b/builtin/apply.c\nindex c24dc54..389898f 100644\n--- a/builtin/apply.c\n+++ b/builtin/apply.c\n@@ -14,6 +14,7 @@\n #include \"builtin.h\"\n #include \"string-list.h\"\n #include \"dir.h\"\n+#include \"diff.h\"\n #include \"parse-options.h\"\n \n /*\n@@ -3241,7 +3242,7 @@ static void stat_patch_list(struct patch *patch)\n \t\tshow_stats(patch);\n \t}\n \n-\tprintf(\" %d files changed, %d insertions(+), %d deletions(-)\\n\", files, adds, dels);\n+\tprint_stat_summary(stdout, files, adds, dels);\n }\n \n static void numstat_patch_list(struct patch *patch)\ndiff --git a/diff.c b/diff.c\nindex 7e15426..5c31b36 100644\n--- a/diff.c\n+++ b/diff.c\n@@ -1322,6 +1322,52 @@ static void fill_print_name(struct diffstat_file *file)\n \tfile->print_name = pname;\n }\n \n+int print_stat_summary(FILE *fp, int files, int insertions, int deletions)\n+{\n+\tstruct strbuf sb = STRBUF_INIT;\n+\tint ret;\n+\n+\tif (!files) {\n+\t\tassert(insertions == 0 && deletions == 0);\n+\t\treturn fputs(_(\" no changes\\n\"), fp);\n+\t}\n+\n+\tstrbuf_addf(&sb,\n+\t\t    ngettext(\" %d file changed\", \" %d files changed\",\n+\t\t\t     files),\n+\t\t    files);\n+\n+\t/*\n+\t * For binary diff, the caller may want to print \"x files\n+\t * changed\" with insertions == 0 && deletions == 0. Not\n+\t * omitting \"0 insertions(+), 0 deletions(-)\" in this case is\n+\t * probably less confusing (i.e skip over \"2 files changed but\n+\t * nothing about added/removed lines? Is this a bug in\n+\t * git??\").\n+\t */\n+\tif (insertions || deletions == 0) {\n+\t\tstrbuf_addf(&sb,\n+\t\t\t    /* TRANSLATORS: \"+\" in (+) is a line\n+\t\t\t       addition marker, do not translate it */\n+\t\t\t    ngettext(\", %d insertion(+)\", \", %d insertions(+)\",\n+\t\t\t\t     insertions),\n+\t\t\t    insertions);\n+\t}\n+\n+\tif (deletions || insertions == 0) {\n+\t\tstrbuf_addf(&sb,\n+\t\t\t    /* TRANSLATORS: \"-\" in (-) is a line\n+\t\t\t       removal marker, do not translate it */\n+\t\t\t    ngettext(\", %d deletion(-)\", \", %d deletions(-)\",\n+\t\t\t\t     deletions),\n+\t\t\t    deletions);\n+\t}\n+\tstrbuf_addch(&sb, '\\n');\n+\tret = fputs(sb.buf, fp);\n+\tstrbuf_release(&sb);\n+\treturn ret;\n+}\n+\n static void show_stats(struct diffstat_t *data, struct diff_options *options)\n {\n \tint i, len, add, del, adds = 0, dels = 0;\n@@ -1475,9 +1521,7 @@ static void show_stats(struct diffstat_t *data, struct diff_options *options)\n \t\textra_shown = 1;\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+\tprint_stat_summary(options->file, total_files, adds, dels);\n }\n \n static void show_shortstats(struct diffstat_t *data, struct diff_options *options)\n@@ -1507,8 +1551,7 @@ static void show_shortstats(struct diffstat_t *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 deletions(-)\\n\",\n-\t       total_files, adds, dels);\n+\tprint_stat_summary(options->file, total_files, adds, dels);\n }\n \n static void show_numstat(struct diffstat_t *data, struct diff_options *options)\ndiff --git a/diff.h b/diff.h\nindex ae71f4c..7af5f1e 100644\n--- a/diff.h\n+++ b/diff.h\n@@ -324,4 +324,7 @@ extern struct userdiff_driver *get_textconv(struct diff_filespec *one);\n \n extern int parse_rename_score(const char **cp_p);\n \n+extern int print_stat_summary(FILE *fp, int files,\n+\t\t\t      int insertions, int deletions);\n+\n #endif /* DIFF_H */\ndiff --git a/t/t0023-crlf-am.sh b/t/t0023-crlf-am.sh\nindex aaed725..18fe27b 100755\n--- a/t/t0023-crlf-am.sh\n+++ b/t/t0023-crlf-am.sh\n@@ -12,7 +12,7 @@ Subject: test1\n \n ---\n  foo |    1 +\n- 1 files changed, 1 insertions(+), 0 deletions(-)\n+ 1 file changed, 1 insertion(+)\n  create mode 100644 foo\n \n diff --git a/foo b/foo\ndiff --git a/t/t1200-tutorial.sh b/t/t1200-tutorial.sh\nindex 5e29e13..9356bea 100755\n--- a/t/t1200-tutorial.sh\n+++ b/t/t1200-tutorial.sh\n@@ -156,7 +156,7 @@ Updating VARIABLE..VARIABLE\n FASTFORWARD (no commit created; -m option ignored)\n  example |    1 +\n  hello   |    1 +\n- 2 files changed, 2 insertions(+), 0 deletions(-)\n+ 2 files changed, 2 insertions(+)\n EOF\n \n test_expect_success 'git resolve' '\ndiff --git a/t/t3300-funny-names.sh b/t/t3300-funny-names.sh\nindex 5e29a05..9f00ada 100755\n--- a/t/t3300-funny-names.sh\n+++ b/t/t3300-funny-names.sh\n@@ -167,7 +167,7 @@ test_expect_success TABS_IN_FILENAMES 'git diff-tree delete with-funny' \\\n test_expect_success TABS_IN_FILENAMES 'setup expect' '\n cat >expected <<\\EOF\n  \"tabs\\t,\\\" (dq) and spaces\"\n- 1 files changed, 0 insertions(+), 0 deletions(-)\n+ 1 file changed, 0 insertions(+), 0 deletions(-)\n EOF\n '\n \ndiff --git a/t/t3508-cherry-pick-many-commits.sh b/t/t3508-cherry-pick-many-commits.sh\nindex 8e09fd0..1b3a344 100755\n--- a/t/t3508-cherry-pick-many-commits.sh\n+++ b/t/t3508-cherry-pick-many-commits.sh\n@@ -38,13 +38,13 @@ test_expect_success 'cherry-pick first..fourth works' '\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 1 file changed, 1 insertion(+)\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 1 file changed, 1 insertion(+)\n \t[master OBJID] fourth\n \t Author: A U Thor <author@example.com>\n-\t 1 files changed, 1 insertions(+), 0 deletions(-)\n+\t 1 file changed, 1 insertion(+)\n \tEOF\n \n \tgit checkout -f master &&\n@@ -64,15 +64,15 @@ test_expect_success 'cherry-pick --strategy resolve first..fourth works' '\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+\t 1 file changed, 1 insertion(+)\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+\t 1 file changed, 1 insertion(+)\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+\t 1 file changed, 1 insertion(+)\n \tEOF\n \n \tgit checkout -f master &&\ndiff --git a/t/t3903-stash.sh b/t/t3903-stash.sh\nindex dbe2ac1..663c60a 100755\n--- a/t/t3903-stash.sh\n+++ b/t/t3903-stash.sh\n@@ -444,7 +444,7 @@ test_expect_success 'stash show - stashes on stack, stash-like argument' '\n \tgit reset --hard &&\n \tcat >expected <<-EOF &&\n \t file |    1 +\n-\t 1 files changed, 1 insertions(+), 0 deletions(-)\n+\t 1 file changed, 1 insertion(+)\n \tEOF\n \tgit stash show ${STASH_ID} >actual &&\n \ttest_cmp expected actual\n@@ -482,7 +482,7 @@ test_expect_success 'stash show - no stashes on stack, stash-like argument' '\n \tgit reset --hard &&\n \tcat >expected <<-EOF &&\n \t file |    1 +\n-\t 1 files changed, 1 insertions(+), 0 deletions(-)\n+\t 1 file changed, 1 insertion(+)\n \tEOF\n \tgit stash show ${STASH_ID} >actual &&\n \ttest_cmp expected actual\ndiff --git a/t/t4013/diff.diff-tree_--cc_--patch-with-stat_--summary_master b/t/t4013/diff.diff-tree_--cc_--patch-with-stat_--summary_master\nindex 3a9f78a..2f8560c 100644\n--- a/t/t4013/diff.diff-tree_--cc_--patch-with-stat_--summary_master\n+++ b/t/t4013/diff.diff-tree_--cc_--patch-with-stat_--summary_master\n@@ -2,7 +2,7 @@ $ git diff-tree --cc --patch-with-stat --summary master\n 59d314ad6f356dd08601a4cd5e530381da3e3c64\n  dir/sub |    2 ++\n  file0   |    3 +++\n- 2 files changed, 5 insertions(+), 0 deletions(-)\n+ 2 files changed, 5 insertions(+)\n \n diff --cc dir/sub\n index cead32e,7289e35..992913c\ndiff --git a/t/t4013/diff.diff-tree_--cc_--patch-with-stat_--summary_side b/t/t4013/diff.diff-tree_--cc_--patch-with-stat_--summary_side\nindex a61ad8c..72e03c1 100644\n--- a/t/t4013/diff.diff-tree_--cc_--patch-with-stat_--summary_side\n+++ b/t/t4013/diff.diff-tree_--cc_--patch-with-stat_--summary_side\n@@ -3,7 +3,7 @@ c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a\n  dir/sub |    2 ++\n  file0   |    3 +++\n  file3   |    4 ++++\n- 3 files changed, 9 insertions(+), 0 deletions(-)\n+ 3 files changed, 9 insertions(+)\n  create mode 100644 file3\n \n diff --git a/dir/sub b/dir/sub\ndiff --git a/t/t4013/diff.diff-tree_--cc_--patch-with-stat_master b/t/t4013/diff.diff-tree_--cc_--patch-with-stat_master\nindex 49f23b9..8b357d9 100644\n--- a/t/t4013/diff.diff-tree_--cc_--patch-with-stat_master\n+++ b/t/t4013/diff.diff-tree_--cc_--patch-with-stat_master\n@@ -2,7 +2,7 @@ $ git diff-tree --cc --patch-with-stat master\n 59d314ad6f356dd08601a4cd5e530381da3e3c64\n  dir/sub |    2 ++\n  file0   |    3 +++\n- 2 files changed, 5 insertions(+), 0 deletions(-)\n+ 2 files changed, 5 insertions(+)\n \n diff --cc dir/sub\n index cead32e,7289e35..992913c\ndiff --git a/t/t4013/diff.diff-tree_--cc_--stat_--summary_master b/t/t4013/diff.diff-tree_--cc_--stat_--summary_master\nindex cc6eb3b..e0568d6 100644\n--- a/t/t4013/diff.diff-tree_--cc_--stat_--summary_master\n+++ b/t/t4013/diff.diff-tree_--cc_--stat_--summary_master\n@@ -2,5 +2,5 @@ $ git diff-tree --cc --stat --summary master\n 59d314ad6f356dd08601a4cd5e530381da3e3c64\n  dir/sub |    2 ++\n  file0   |    3 +++\n- 2 files changed, 5 insertions(+), 0 deletions(-)\n+ 2 files changed, 5 insertions(+)\n $\ndiff --git a/t/t4013/diff.diff-tree_--cc_--stat_--summary_side b/t/t4013/diff.diff-tree_--cc_--stat_--summary_side\nindex 50362be..5afc823 100644\n--- a/t/t4013/diff.diff-tree_--cc_--stat_--summary_side\n+++ b/t/t4013/diff.diff-tree_--cc_--stat_--summary_side\n@@ -3,6 +3,6 @@ c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a\n  dir/sub |    2 ++\n  file0   |    3 +++\n  file3   |    4 ++++\n- 3 files changed, 9 insertions(+), 0 deletions(-)\n+ 3 files changed, 9 insertions(+)\n  create mode 100644 file3\n $\ndiff --git a/t/t4013/diff.diff-tree_--cc_--stat_master b/t/t4013/diff.diff-tree_--cc_--stat_master\nindex fae7f33..f48367a 100644\n--- a/t/t4013/diff.diff-tree_--cc_--stat_master\n+++ b/t/t4013/diff.diff-tree_--cc_--stat_master\n@@ -2,5 +2,5 @@ $ git diff-tree --cc --stat master\n 59d314ad6f356dd08601a4cd5e530381da3e3c64\n  dir/sub |    2 ++\n  file0   |    3 +++\n- 2 files changed, 5 insertions(+), 0 deletions(-)\n+ 2 files changed, 5 insertions(+)\n $\ndiff --git a/t/t4013/diff.diff-tree_--pretty=oneline_--root_--patch-with-stat_initial b/t/t4013/diff.diff-tree_--pretty=oneline_--root_--patch-with-stat_initial\nindex d5c333a..590864c 100644\n--- a/t/t4013/diff.diff-tree_--pretty=oneline_--root_--patch-with-stat_initial\n+++ b/t/t4013/diff.diff-tree_--pretty=oneline_--root_--patch-with-stat_initial\n@@ -3,7 +3,7 @@ $ git diff-tree --pretty=oneline --root --patch-with-stat initial\n  dir/sub |    2 ++\n  file0   |    3 +++\n  file2   |    3 +++\n- 3 files changed, 8 insertions(+), 0 deletions(-)\n+ 3 files changed, 8 insertions(+)\n \n diff --git a/dir/sub b/dir/sub\n new file mode 100644\ndiff --git a/t/t4013/diff.diff-tree_--pretty_--patch-with-stat_side b/t/t4013/diff.diff-tree_--pretty_--patch-with-stat_side\nindex 4d30e7e..e05e778 100644\n--- a/t/t4013/diff.diff-tree_--pretty_--patch-with-stat_side\n+++ b/t/t4013/diff.diff-tree_--pretty_--patch-with-stat_side\n@@ -8,7 +8,7 @@ Date:   Mon Jun 26 00:03:00 2006 +0000\n  dir/sub |    2 ++\n  file0   |    3 +++\n  file3   |    4 ++++\n- 3 files changed, 9 insertions(+), 0 deletions(-)\n+ 3 files changed, 9 insertions(+)\n \n diff --git a/dir/sub b/dir/sub\n index 35d242b..7289e35 100644\ndiff --git a/t/t4013/diff.diff-tree_--pretty_--root_--patch-with-stat_initial b/t/t4013/diff.diff-tree_--pretty_--root_--patch-with-stat_initial\nindex 7dfa6af..0e2c956 100644\n--- a/t/t4013/diff.diff-tree_--pretty_--root_--patch-with-stat_initial\n+++ b/t/t4013/diff.diff-tree_--pretty_--root_--patch-with-stat_initial\n@@ -8,7 +8,7 @@ Date:   Mon Jun 26 00:00:00 2006 +0000\n  dir/sub |    2 ++\n  file0   |    3 +++\n  file2   |    3 +++\n- 3 files changed, 8 insertions(+), 0 deletions(-)\n+ 3 files changed, 8 insertions(+)\n \n diff --git a/dir/sub b/dir/sub\n new file mode 100644\ndiff --git a/t/t4013/diff.diff-tree_--pretty_--root_--stat_--summary_initial b/t/t4013/diff.diff-tree_--pretty_--root_--stat_--summary_initial\nindex 43bfce2..384fa44 100644\n--- a/t/t4013/diff.diff-tree_--pretty_--root_--stat_--summary_initial\n+++ b/t/t4013/diff.diff-tree_--pretty_--root_--stat_--summary_initial\n@@ -8,7 +8,7 @@ Date:   Mon Jun 26 00:00:00 2006 +0000\n  dir/sub |    2 ++\n  file0   |    3 +++\n  file2   |    3 +++\n- 3 files changed, 8 insertions(+), 0 deletions(-)\n+ 3 files changed, 8 insertions(+)\n  create mode 100644 dir/sub\n  create mode 100644 file0\n  create mode 100644 file2\ndiff --git a/t/t4013/diff.diff-tree_--pretty_--root_--stat_initial b/t/t4013/diff.diff-tree_--pretty_--root_--stat_initial\nindex 9154aa4..10384a8 100644\n--- a/t/t4013/diff.diff-tree_--pretty_--root_--stat_initial\n+++ b/t/t4013/diff.diff-tree_--pretty_--root_--stat_initial\n@@ -8,5 +8,5 @@ Date:   Mon Jun 26 00:00:00 2006 +0000\n  dir/sub |    2 ++\n  file0   |    3 +++\n  file2   |    3 +++\n- 3 files changed, 8 insertions(+), 0 deletions(-)\n+ 3 files changed, 8 insertions(+)\n $\ndiff --git a/t/t4013/diff.diff-tree_--root_--patch-with-stat_initial b/t/t4013/diff.diff-tree_--root_--patch-with-stat_initial\nindex 1562b62..f57062e 100644\n--- a/t/t4013/diff.diff-tree_--root_--patch-with-stat_initial\n+++ b/t/t4013/diff.diff-tree_--root_--patch-with-stat_initial\n@@ -3,7 +3,7 @@ $ git diff-tree --root --patch-with-stat initial\n  dir/sub |    2 ++\n  file0   |    3 +++\n  file2   |    3 +++\n- 3 files changed, 8 insertions(+), 0 deletions(-)\n+ 3 files changed, 8 insertions(+)\n \n diff --git a/dir/sub b/dir/sub\n new file mode 100644\ndiff --git a/t/t4013/diff.diff-tree_-c_--stat_--summary_master b/t/t4013/diff.diff-tree_-c_--stat_--summary_master\nindex ac9f641..7088683 100644\n--- a/t/t4013/diff.diff-tree_-c_--stat_--summary_master\n+++ b/t/t4013/diff.diff-tree_-c_--stat_--summary_master\n@@ -2,5 +2,5 @@ $ git diff-tree -c --stat --summary master\n 59d314ad6f356dd08601a4cd5e530381da3e3c64\n  dir/sub |    2 ++\n  file0   |    3 +++\n- 2 files changed, 5 insertions(+), 0 deletions(-)\n+ 2 files changed, 5 insertions(+)\n $\ndiff --git a/t/t4013/diff.diff-tree_-c_--stat_--summary_side b/t/t4013/diff.diff-tree_-c_--stat_--summary_side\nindex 2afcca1..ef216ab 100644\n--- a/t/t4013/diff.diff-tree_-c_--stat_--summary_side\n+++ b/t/t4013/diff.diff-tree_-c_--stat_--summary_side\n@@ -3,6 +3,6 @@ c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a\n  dir/sub |    2 ++\n  file0   |    3 +++\n  file3   |    4 ++++\n- 3 files changed, 9 insertions(+), 0 deletions(-)\n+ 3 files changed, 9 insertions(+)\n  create mode 100644 file3\n $\ndiff --git a/t/t4013/diff.diff-tree_-c_--stat_master b/t/t4013/diff.diff-tree_-c_--stat_master\nindex c2fe6a9..ad19f10 100644\n--- a/t/t4013/diff.diff-tree_-c_--stat_master\n+++ b/t/t4013/diff.diff-tree_-c_--stat_master\n@@ -2,5 +2,5 @@ $ git diff-tree -c --stat master\n 59d314ad6f356dd08601a4cd5e530381da3e3c64\n  dir/sub |    2 ++\n  file0   |    3 +++\n- 2 files changed, 5 insertions(+), 0 deletions(-)\n+ 2 files changed, 5 insertions(+)\n $\ndiff --git a/t/t4013/diff.diff_--patch-with-stat_-r_initial..side b/t/t4013/diff.diff_--patch-with-stat_-r_initial..side\nindex 9ed317a..ddad917 100644\n--- a/t/t4013/diff.diff_--patch-with-stat_-r_initial..side\n+++ b/t/t4013/diff.diff_--patch-with-stat_-r_initial..side\n@@ -2,7 +2,7 @@ $ git diff --patch-with-stat -r initial..side\n  dir/sub |    2 ++\n  file0   |    3 +++\n  file3   |    4 ++++\n- 3 files changed, 9 insertions(+), 0 deletions(-)\n+ 3 files changed, 9 insertions(+)\n \n diff --git a/dir/sub b/dir/sub\n index 35d242b..7289e35 100644\ndiff --git a/t/t4013/diff.diff_--patch-with-stat_initial..side b/t/t4013/diff.diff_--patch-with-stat_initial..side\nindex 8b50629..bdbd114 100644\n--- a/t/t4013/diff.diff_--patch-with-stat_initial..side\n+++ b/t/t4013/diff.diff_--patch-with-stat_initial..side\n@@ -2,7 +2,7 @@ $ git diff --patch-with-stat initial..side\n  dir/sub |    2 ++\n  file0   |    3 +++\n  file3   |    4 ++++\n- 3 files changed, 9 insertions(+), 0 deletions(-)\n+ 3 files changed, 9 insertions(+)\n \n diff --git a/dir/sub b/dir/sub\n index 35d242b..7289e35 100644\ndiff --git a/t/t4013/diff.diff_--stat_initial..side b/t/t4013/diff.diff_--stat_initial..side\nindex 0517b5d..6d08f3d 100644\n--- a/t/t4013/diff.diff_--stat_initial..side\n+++ b/t/t4013/diff.diff_--stat_initial..side\n@@ -2,5 +2,5 @@ $ git diff --stat initial..side\n  dir/sub |    2 ++\n  file0   |    3 +++\n  file3   |    4 ++++\n- 3 files changed, 9 insertions(+), 0 deletions(-)\n+ 3 files changed, 9 insertions(+)\n $\ndiff --git a/t/t4013/diff.diff_-r_--stat_initial..side b/t/t4013/diff.diff_-r_--stat_initial..side\nindex 245220d..2ddb254 100644\n--- a/t/t4013/diff.diff_-r_--stat_initial..side\n+++ b/t/t4013/diff.diff_-r_--stat_initial..side\n@@ -2,5 +2,5 @@ $ git diff -r --stat initial..side\n  dir/sub |    2 ++\n  file0   |    3 +++\n  file3   |    4 ++++\n- 3 files changed, 9 insertions(+), 0 deletions(-)\n+ 3 files changed, 9 insertions(+)\n $\ndiff --git a/t/t4013/diff.format-patch_--attach_--stdout_--suffix=.diff_initial..side b/t/t4013/diff.format-patch_--attach_--stdout_--suffix=.diff_initial..side\nindex 52116d3..3cab049 100644\n--- a/t/t4013/diff.format-patch_--attach_--stdout_--suffix=.diff_initial..side\n+++ b/t/t4013/diff.format-patch_--attach_--stdout_--suffix=.diff_initial..side\n@@ -15,7 +15,7 @@ Content-Transfer-Encoding: 8bit\n  dir/sub |    2 ++\n  file0   |    3 +++\n  file3   |    4 ++++\n- 3 files changed, 9 insertions(+), 0 deletions(-)\n+ 3 files changed, 9 insertions(+)\n  create mode 100644 file3\n \n \ndiff --git a/t/t4013/diff.format-patch_--attach_--stdout_initial..master b/t/t4013/diff.format-patch_--attach_--stdout_initial..master\nindex ce49bd6..564a4d3 100644\n--- a/t/t4013/diff.format-patch_--attach_--stdout_initial..master\n+++ b/t/t4013/diff.format-patch_--attach_--stdout_initial..master\n@@ -75,7 +75,7 @@ Content-Transfer-Encoding: 8bit\n ---\n  dir/sub |    2 ++\n  file1   |    3 +++\n- 2 files changed, 5 insertions(+), 0 deletions(-)\n+ 2 files changed, 5 insertions(+)\n  create mode 100644 file1\n \n \n@@ -124,7 +124,7 @@ Content-Transfer-Encoding: 8bit\n  dir/sub |    2 ++\n  file0   |    3 +++\n  file3   |    4 ++++\n- 3 files changed, 9 insertions(+), 0 deletions(-)\n+ 3 files changed, 9 insertions(+)\n  create mode 100644 file3\n \n \ndiff --git a/t/t4013/diff.format-patch_--attach_--stdout_initial..master^ b/t/t4013/diff.format-patch_--attach_--stdout_initial..master^\nindex 5f1b238..4f28460 100644\n--- a/t/t4013/diff.format-patch_--attach_--stdout_initial..master^\n+++ b/t/t4013/diff.format-patch_--attach_--stdout_initial..master^\n@@ -75,7 +75,7 @@ Content-Transfer-Encoding: 8bit\n ---\n  dir/sub |    2 ++\n  file1   |    3 +++\n- 2 files changed, 5 insertions(+), 0 deletions(-)\n+ 2 files changed, 5 insertions(+)\n  create mode 100644 file1\n \n \ndiff --git a/t/t4013/diff.format-patch_--attach_--stdout_initial..side b/t/t4013/diff.format-patch_--attach_--stdout_initial..side\nindex 4a2364a..b10cc2e 100644\n--- a/t/t4013/diff.format-patch_--attach_--stdout_initial..side\n+++ b/t/t4013/diff.format-patch_--attach_--stdout_initial..side\n@@ -15,7 +15,7 @@ Content-Transfer-Encoding: 8bit\n  dir/sub |    2 ++\n  file0   |    3 +++\n  file3   |    4 ++++\n- 3 files changed, 9 insertions(+), 0 deletions(-)\n+ 3 files changed, 9 insertions(+)\n  create mode 100644 file3\n \n \ndiff --git a/t/t4013/diff.format-patch_--inline_--stdout_--numbered-files_initial..master b/t/t4013/diff.format-patch_--inline_--stdout_--numbered-files_initial..master\nindex 43b81eb..a976a8a 100644\n--- a/t/t4013/diff.format-patch_--inline_--stdout_--numbered-files_initial..master\n+++ b/t/t4013/diff.format-patch_--inline_--stdout_--numbered-files_initial..master\n@@ -75,7 +75,7 @@ Content-Transfer-Encoding: 8bit\n ---\n  dir/sub |    2 ++\n  file1   |    3 +++\n- 2 files changed, 5 insertions(+), 0 deletions(-)\n+ 2 files changed, 5 insertions(+)\n  create mode 100644 file1\n \n \n@@ -124,7 +124,7 @@ Content-Transfer-Encoding: 8bit\n  dir/sub |    2 ++\n  file0   |    3 +++\n  file3   |    4 ++++\n- 3 files changed, 9 insertions(+), 0 deletions(-)\n+ 3 files changed, 9 insertions(+)\n  create mode 100644 file3\n \n \ndiff --git a/t/t4013/diff.format-patch_--inline_--stdout_--subject-prefix=TESTCASE_initial..master b/t/t4013/diff.format-patch_--inline_--stdout_--subject-prefix=TESTCASE_initial..master\nindex ca3f60b..b4fd664 100644\n--- a/t/t4013/diff.format-patch_--inline_--stdout_--subject-prefix=TESTCASE_initial..master\n+++ b/t/t4013/diff.format-patch_--inline_--stdout_--subject-prefix=TESTCASE_initial..master\n@@ -75,7 +75,7 @@ Content-Transfer-Encoding: 8bit\n ---\n  dir/sub |    2 ++\n  file1   |    3 +++\n- 2 files changed, 5 insertions(+), 0 deletions(-)\n+ 2 files changed, 5 insertions(+)\n  create mode 100644 file1\n \n \n@@ -124,7 +124,7 @@ Content-Transfer-Encoding: 8bit\n  dir/sub |    2 ++\n  file0   |    3 +++\n  file3   |    4 ++++\n- 3 files changed, 9 insertions(+), 0 deletions(-)\n+ 3 files changed, 9 insertions(+)\n  create mode 100644 file3\n \n \ndiff --git a/t/t4013/diff.format-patch_--inline_--stdout_initial..master b/t/t4013/diff.format-patch_--inline_--stdout_initial..master\nindex 08f2301..0d31036 100644\n--- a/t/t4013/diff.format-patch_--inline_--stdout_initial..master\n+++ b/t/t4013/diff.format-patch_--inline_--stdout_initial..master\n@@ -75,7 +75,7 @@ Content-Transfer-Encoding: 8bit\n ---\n  dir/sub |    2 ++\n  file1   |    3 +++\n- 2 files changed, 5 insertions(+), 0 deletions(-)\n+ 2 files changed, 5 insertions(+)\n  create mode 100644 file1\n \n \n@@ -124,7 +124,7 @@ Content-Transfer-Encoding: 8bit\n  dir/sub |    2 ++\n  file0   |    3 +++\n  file3   |    4 ++++\n- 3 files changed, 9 insertions(+), 0 deletions(-)\n+ 3 files changed, 9 insertions(+)\n  create mode 100644 file3\n \n \ndiff --git a/t/t4013/diff.format-patch_--inline_--stdout_initial..master^ b/t/t4013/diff.format-patch_--inline_--stdout_initial..master^\nindex 07f1230..18d4714 100644\n--- a/t/t4013/diff.format-patch_--inline_--stdout_initial..master^\n+++ b/t/t4013/diff.format-patch_--inline_--stdout_initial..master^\n@@ -75,7 +75,7 @@ Content-Transfer-Encoding: 8bit\n ---\n  dir/sub |    2 ++\n  file1   |    3 +++\n- 2 files changed, 5 insertions(+), 0 deletions(-)\n+ 2 files changed, 5 insertions(+)\n  create mode 100644 file1\n \n \ndiff --git a/t/t4013/diff.format-patch_--inline_--stdout_initial..side b/t/t4013/diff.format-patch_--inline_--stdout_initial..side\nindex 67633d4..3572f20 100644\n--- a/t/t4013/diff.format-patch_--inline_--stdout_initial..side\n+++ b/t/t4013/diff.format-patch_--inline_--stdout_initial..side\n@@ -15,7 +15,7 @@ Content-Transfer-Encoding: 8bit\n  dir/sub |    2 ++\n  file0   |    3 +++\n  file3   |    4 ++++\n- 3 files changed, 9 insertions(+), 0 deletions(-)\n+ 3 files changed, 9 insertions(+)\n  create mode 100644 file3\n \n \ndiff --git a/t/t4013/diff.format-patch_--stdout_--cover-letter_-n_initial..master^ b/t/t4013/diff.format-patch_--stdout_--cover-letter_-n_initial..master^\nindex 3b4e113..54cdcda 100644\n--- a/t/t4013/diff.format-patch_--stdout_--cover-letter_-n_initial..master^\n+++ b/t/t4013/diff.format-patch_--stdout_--cover-letter_-n_initial..master^\n@@ -75,7 +75,7 @@ Subject: [DIFFERENT_PREFIX 2/2] Third\n ---\n  dir/sub |    2 ++\n  file1   |    3 +++\n- 2 files changed, 5 insertions(+), 0 deletions(-)\n+ 2 files changed, 5 insertions(+)\n  create mode 100644 file1\n \n diff --git a/dir/sub b/dir/sub\ndiff --git a/t/t4013/diff.format-patch_--stdout_--no-numbered_initial..master b/t/t4013/diff.format-patch_--stdout_--no-numbered_initial..master\nindex f7752eb..23194eb 100644\n--- a/t/t4013/diff.format-patch_--stdout_--no-numbered_initial..master\n+++ b/t/t4013/diff.format-patch_--stdout_--no-numbered_initial..master\n@@ -53,7 +53,7 @@ Subject: [PATCH] Third\n ---\n  dir/sub |    2 ++\n  file1   |    3 +++\n- 2 files changed, 5 insertions(+), 0 deletions(-)\n+ 2 files changed, 5 insertions(+)\n  create mode 100644 file1\n \n diff --git a/dir/sub b/dir/sub\n@@ -88,7 +88,7 @@ Subject: [PATCH] Side\n  dir/sub |    2 ++\n  file0   |    3 +++\n  file3   |    4 ++++\n- 3 files changed, 9 insertions(+), 0 deletions(-)\n+ 3 files changed, 9 insertions(+)\n  create mode 100644 file3\n \n diff --git a/dir/sub b/dir/sub\ndiff --git a/t/t4013/diff.format-patch_--stdout_--numbered_initial..master b/t/t4013/diff.format-patch_--stdout_--numbered_initial..master\nindex 8e67dbf..78f1a80 100644\n--- a/t/t4013/diff.format-patch_--stdout_--numbered_initial..master\n+++ b/t/t4013/diff.format-patch_--stdout_--numbered_initial..master\n@@ -53,7 +53,7 @@ Subject: [PATCH 2/3] Third\n ---\n  dir/sub |    2 ++\n  file1   |    3 +++\n- 2 files changed, 5 insertions(+), 0 deletions(-)\n+ 2 files changed, 5 insertions(+)\n  create mode 100644 file1\n \n diff --git a/dir/sub b/dir/sub\n@@ -88,7 +88,7 @@ Subject: [PATCH 3/3] Side\n  dir/sub |    2 ++\n  file0   |    3 +++\n  file3   |    4 ++++\n- 3 files changed, 9 insertions(+), 0 deletions(-)\n+ 3 files changed, 9 insertions(+)\n  create mode 100644 file3\n \n diff --git a/dir/sub b/dir/sub\ndiff --git a/t/t4013/diff.format-patch_--stdout_initial..master b/t/t4013/diff.format-patch_--stdout_initial..master\nindex 7b89978..a3dab7f 100644\n--- a/t/t4013/diff.format-patch_--stdout_initial..master\n+++ b/t/t4013/diff.format-patch_--stdout_initial..master\n@@ -53,7 +53,7 @@ Subject: [PATCH 2/3] Third\n ---\n  dir/sub |    2 ++\n  file1   |    3 +++\n- 2 files changed, 5 insertions(+), 0 deletions(-)\n+ 2 files changed, 5 insertions(+)\n  create mode 100644 file1\n \n diff --git a/dir/sub b/dir/sub\n@@ -88,7 +88,7 @@ Subject: [PATCH 3/3] Side\n  dir/sub |    2 ++\n  file0   |    3 +++\n  file3   |    4 ++++\n- 3 files changed, 9 insertions(+), 0 deletions(-)\n+ 3 files changed, 9 insertions(+)\n  create mode 100644 file3\n \n diff --git a/dir/sub b/dir/sub\ndiff --git a/t/t4013/diff.format-patch_--stdout_initial..master^ b/t/t4013/diff.format-patch_--stdout_initial..master^\nindex b7f9725..39f4a3f 100644\n--- a/t/t4013/diff.format-patch_--stdout_initial..master^\n+++ b/t/t4013/diff.format-patch_--stdout_initial..master^\n@@ -53,7 +53,7 @@ Subject: [PATCH 2/2] Third\n ---\n  dir/sub |    2 ++\n  file1   |    3 +++\n- 2 files changed, 5 insertions(+), 0 deletions(-)\n+ 2 files changed, 5 insertions(+)\n  create mode 100644 file1\n \n diff --git a/dir/sub b/dir/sub\ndiff --git a/t/t4013/diff.format-patch_--stdout_initial..side b/t/t4013/diff.format-patch_--stdout_initial..side\nindex e765088..8810920 100644\n--- a/t/t4013/diff.format-patch_--stdout_initial..side\n+++ b/t/t4013/diff.format-patch_--stdout_initial..side\n@@ -8,7 +8,7 @@ Subject: [PATCH] Side\n  dir/sub |    2 ++\n  file0   |    3 +++\n  file3   |    4 ++++\n- 3 files changed, 9 insertions(+), 0 deletions(-)\n+ 3 files changed, 9 insertions(+)\n  create mode 100644 file3\n \n diff --git a/dir/sub b/dir/sub\ndiff --git a/t/t4013/diff.log_--patch-with-stat_--summary_master_--_dir_ b/t/t4013/diff.log_--patch-with-stat_--summary_master_--_dir_\nindex bd7f5c0..4085bbd 100644\n--- a/t/t4013/diff.log_--patch-with-stat_--summary_master_--_dir_\n+++ b/t/t4013/diff.log_--patch-with-stat_--summary_master_--_dir_\n@@ -13,7 +13,7 @@ Date:   Mon Jun 26 00:03:00 2006 +0000\n     Side\n ---\n  dir/sub |    2 ++\n- 1 files changed, 2 insertions(+), 0 deletions(-)\n+ 1 file changed, 2 insertions(+)\n \n diff --git a/dir/sub b/dir/sub\n index 35d242b..7289e35 100644\n@@ -32,7 +32,7 @@ Date:   Mon Jun 26 00:02:00 2006 +0000\n     Third\n ---\n  dir/sub |    2 ++\n- 1 files changed, 2 insertions(+), 0 deletions(-)\n+ 1 file changed, 2 insertions(+)\n \n diff --git a/dir/sub b/dir/sub\n index 8422d40..cead32e 100644\n@@ -54,7 +54,7 @@ Date:   Mon Jun 26 00:01:00 2006 +0000\n     This is the second commit.\n ---\n  dir/sub |    2 ++\n- 1 files changed, 2 insertions(+), 0 deletions(-)\n+ 1 file changed, 2 insertions(+)\n \n diff --git a/dir/sub b/dir/sub\n index 35d242b..8422d40 100644\ndiff --git a/t/t4013/diff.log_--patch-with-stat_master b/t/t4013/diff.log_--patch-with-stat_master\nindex 14595a6..4586279 100644\n--- a/t/t4013/diff.log_--patch-with-stat_master\n+++ b/t/t4013/diff.log_--patch-with-stat_master\n@@ -15,7 +15,7 @@ Date:   Mon Jun 26 00:03:00 2006 +0000\n  dir/sub |    2 ++\n  file0   |    3 +++\n  file3   |    4 ++++\n- 3 files changed, 9 insertions(+), 0 deletions(-)\n+ 3 files changed, 9 insertions(+)\n \n diff --git a/dir/sub b/dir/sub\n index 35d242b..7289e35 100644\n@@ -56,7 +56,7 @@ Date:   Mon Jun 26 00:02:00 2006 +0000\n ---\n  dir/sub |    2 ++\n  file1   |    3 +++\n- 2 files changed, 5 insertions(+), 0 deletions(-)\n+ 2 files changed, 5 insertions(+)\n \n diff --git a/dir/sub b/dir/sub\n index 8422d40..cead32e 100644\ndiff --git a/t/t4013/diff.log_--patch-with-stat_master_--_dir_ b/t/t4013/diff.log_--patch-with-stat_master_--_dir_\nindex 5a4e727..6e172cf 100644\n--- a/t/t4013/diff.log_--patch-with-stat_master_--_dir_\n+++ b/t/t4013/diff.log_--patch-with-stat_master_--_dir_\n@@ -13,7 +13,7 @@ Date:   Mon Jun 26 00:03:00 2006 +0000\n     Side\n ---\n  dir/sub |    2 ++\n- 1 files changed, 2 insertions(+), 0 deletions(-)\n+ 1 file changed, 2 insertions(+)\n \n diff --git a/dir/sub b/dir/sub\n index 35d242b..7289e35 100644\n@@ -32,7 +32,7 @@ Date:   Mon Jun 26 00:02:00 2006 +0000\n     Third\n ---\n  dir/sub |    2 ++\n- 1 files changed, 2 insertions(+), 0 deletions(-)\n+ 1 file changed, 2 insertions(+)\n \n diff --git a/dir/sub b/dir/sub\n index 8422d40..cead32e 100644\n@@ -54,7 +54,7 @@ Date:   Mon Jun 26 00:01:00 2006 +0000\n     This is the second commit.\n ---\n  dir/sub |    2 ++\n- 1 files changed, 2 insertions(+), 0 deletions(-)\n+ 1 file changed, 2 insertions(+)\n \n diff --git a/dir/sub b/dir/sub\n index 35d242b..8422d40 100644\ndiff --git a/t/t4013/diff.log_--root_--cc_--patch-with-stat_--summary_master b/t/t4013/diff.log_--root_--cc_--patch-with-stat_--summary_master\nindex df0aaa9..48b0d4b 100644\n--- a/t/t4013/diff.log_--root_--cc_--patch-with-stat_--summary_master\n+++ b/t/t4013/diff.log_--root_--cc_--patch-with-stat_--summary_master\n@@ -8,7 +8,7 @@ Date:   Mon Jun 26 00:04:00 2006 +0000\n \n  dir/sub |    2 ++\n  file0   |    3 +++\n- 2 files changed, 5 insertions(+), 0 deletions(-)\n+ 2 files changed, 5 insertions(+)\n \n diff --cc dir/sub\n index cead32e,7289e35..992913c\n@@ -47,7 +47,7 @@ Date:   Mon Jun 26 00:03:00 2006 +0000\n  dir/sub |    2 ++\n  file0   |    3 +++\n  file3   |    4 ++++\n- 3 files changed, 9 insertions(+), 0 deletions(-)\n+ 3 files changed, 9 insertions(+)\n  create mode 100644 file3\n \n diff --git a/dir/sub b/dir/sub\n@@ -89,7 +89,7 @@ Date:   Mon Jun 26 00:02:00 2006 +0000\n ---\n  dir/sub |    2 ++\n  file1   |    3 +++\n- 2 files changed, 5 insertions(+), 0 deletions(-)\n+ 2 files changed, 5 insertions(+)\n  create mode 100644 file1\n \n diff --git a/dir/sub b/dir/sub\n@@ -165,7 +165,7 @@ Date:   Mon Jun 26 00:00:00 2006 +0000\n  dir/sub |    2 ++\n  file0   |    3 +++\n  file2   |    3 +++\n- 3 files changed, 8 insertions(+), 0 deletions(-)\n+ 3 files changed, 8 insertions(+)\n  create mode 100644 dir/sub\n  create mode 100644 file0\n  create mode 100644 file2\ndiff --git a/t/t4013/diff.log_--root_--patch-with-stat_--summary_master b/t/t4013/diff.log_--root_--patch-with-stat_--summary_master\nindex c11b5f2c..f9dc512 100644\n--- a/t/t4013/diff.log_--root_--patch-with-stat_--summary_master\n+++ b/t/t4013/diff.log_--root_--patch-with-stat_--summary_master\n@@ -15,7 +15,7 @@ Date:   Mon Jun 26 00:03:00 2006 +0000\n  dir/sub |    2 ++\n  file0   |    3 +++\n  file3   |    4 ++++\n- 3 files changed, 9 insertions(+), 0 deletions(-)\n+ 3 files changed, 9 insertions(+)\n  create mode 100644 file3\n \n diff --git a/dir/sub b/dir/sub\n@@ -57,7 +57,7 @@ Date:   Mon Jun 26 00:02:00 2006 +0000\n ---\n  dir/sub |    2 ++\n  file1   |    3 +++\n- 2 files changed, 5 insertions(+), 0 deletions(-)\n+ 2 files changed, 5 insertions(+)\n  create mode 100644 file1\n \n diff --git a/dir/sub b/dir/sub\n@@ -133,7 +133,7 @@ Date:   Mon Jun 26 00:00:00 2006 +0000\n  dir/sub |    2 ++\n  file0   |    3 +++\n  file2   |    3 +++\n- 3 files changed, 8 insertions(+), 0 deletions(-)\n+ 3 files changed, 8 insertions(+)\n  create mode 100644 dir/sub\n  create mode 100644 file0\n  create mode 100644 file2\ndiff --git a/t/t4013/diff.log_--root_--patch-with-stat_master b/t/t4013/diff.log_--root_--patch-with-stat_master\nindex 5f0c98f..0807ece 100644\n--- a/t/t4013/diff.log_--root_--patch-with-stat_master\n+++ b/t/t4013/diff.log_--root_--patch-with-stat_master\n@@ -15,7 +15,7 @@ Date:   Mon Jun 26 00:03:00 2006 +0000\n  dir/sub |    2 ++\n  file0   |    3 +++\n  file3   |    4 ++++\n- 3 files changed, 9 insertions(+), 0 deletions(-)\n+ 3 files changed, 9 insertions(+)\n \n diff --git a/dir/sub b/dir/sub\n index 35d242b..7289e35 100644\n@@ -56,7 +56,7 @@ Date:   Mon Jun 26 00:02:00 2006 +0000\n ---\n  dir/sub |    2 ++\n  file1   |    3 +++\n- 2 files changed, 5 insertions(+), 0 deletions(-)\n+ 2 files changed, 5 insertions(+)\n \n diff --git a/dir/sub b/dir/sub\n index 8422d40..cead32e 100644\n@@ -130,7 +130,7 @@ Date:   Mon Jun 26 00:00:00 2006 +0000\n  dir/sub |    2 ++\n  file0   |    3 +++\n  file2   |    3 +++\n- 3 files changed, 8 insertions(+), 0 deletions(-)\n+ 3 files changed, 8 insertions(+)\n \n diff --git a/dir/sub b/dir/sub\n new file mode 100644\ndiff --git a/t/t4013/diff.log_--root_-c_--patch-with-stat_--summary_master b/t/t4013/diff.log_--root_-c_--patch-with-stat_--summary_master\nindex e62c368..84f5ef6 100644\n--- a/t/t4013/diff.log_--root_-c_--patch-with-stat_--summary_master\n+++ b/t/t4013/diff.log_--root_-c_--patch-with-stat_--summary_master\n@@ -8,7 +8,7 @@ Date:   Mon Jun 26 00:04:00 2006 +0000\n \n  dir/sub |    2 ++\n  file0   |    3 +++\n- 2 files changed, 5 insertions(+), 0 deletions(-)\n+ 2 files changed, 5 insertions(+)\n \n diff --combined dir/sub\n index cead32e,7289e35..992913c\n@@ -47,7 +47,7 @@ Date:   Mon Jun 26 00:03:00 2006 +0000\n  dir/sub |    2 ++\n  file0   |    3 +++\n  file3   |    4 ++++\n- 3 files changed, 9 insertions(+), 0 deletions(-)\n+ 3 files changed, 9 insertions(+)\n  create mode 100644 file3\n \n diff --git a/dir/sub b/dir/sub\n@@ -89,7 +89,7 @@ Date:   Mon Jun 26 00:02:00 2006 +0000\n ---\n  dir/sub |    2 ++\n  file1   |    3 +++\n- 2 files changed, 5 insertions(+), 0 deletions(-)\n+ 2 files changed, 5 insertions(+)\n  create mode 100644 file1\n \n diff --git a/dir/sub b/dir/sub\n@@ -165,7 +165,7 @@ Date:   Mon Jun 26 00:00:00 2006 +0000\n  dir/sub |    2 ++\n  file0   |    3 +++\n  file2   |    3 +++\n- 3 files changed, 8 insertions(+), 0 deletions(-)\n+ 3 files changed, 8 insertions(+)\n  create mode 100644 dir/sub\n  create mode 100644 file0\n  create mode 100644 file2\ndiff --git a/t/t4013/diff.show_--patch-with-stat_--summary_side b/t/t4013/diff.show_--patch-with-stat_--summary_side\nindex 377f2b7..e60384d 100644\n--- a/t/t4013/diff.show_--patch-with-stat_--summary_side\n+++ b/t/t4013/diff.show_--patch-with-stat_--summary_side\n@@ -8,7 +8,7 @@ Date:   Mon Jun 26 00:03:00 2006 +0000\n  dir/sub |    2 ++\n  file0   |    3 +++\n  file3   |    4 ++++\n- 3 files changed, 9 insertions(+), 0 deletions(-)\n+ 3 files changed, 9 insertions(+)\n  create mode 100644 file3\n \n diff --git a/dir/sub b/dir/sub\ndiff --git a/t/t4013/diff.show_--patch-with-stat_side b/t/t4013/diff.show_--patch-with-stat_side\nindex fb14c53..a3a3255 100644\n--- a/t/t4013/diff.show_--patch-with-stat_side\n+++ b/t/t4013/diff.show_--patch-with-stat_side\n@@ -8,7 +8,7 @@ Date:   Mon Jun 26 00:03:00 2006 +0000\n  dir/sub |    2 ++\n  file0   |    3 +++\n  file3   |    4 ++++\n- 3 files changed, 9 insertions(+), 0 deletions(-)\n+ 3 files changed, 9 insertions(+)\n \n diff --git a/dir/sub b/dir/sub\n index 35d242b..7289e35 100644\ndiff --git a/t/t4013/diff.show_--stat_--summary_side b/t/t4013/diff.show_--stat_--summary_side\nindex 5bd5977..d16f464 100644\n--- a/t/t4013/diff.show_--stat_--summary_side\n+++ b/t/t4013/diff.show_--stat_--summary_side\n@@ -8,6 +8,6 @@ Date:   Mon Jun 26 00:03:00 2006 +0000\n  dir/sub |    2 ++\n  file0   |    3 +++\n  file3   |    4 ++++\n- 3 files changed, 9 insertions(+), 0 deletions(-)\n+ 3 files changed, 9 insertions(+)\n  create mode 100644 file3\n $\ndiff --git a/t/t4013/diff.show_--stat_side b/t/t4013/diff.show_--stat_side\nindex 3b22327..6300c05 100644\n--- a/t/t4013/diff.show_--stat_side\n+++ b/t/t4013/diff.show_--stat_side\n@@ -8,5 +8,5 @@ Date:   Mon Jun 26 00:03:00 2006 +0000\n  dir/sub |    2 ++\n  file0   |    3 +++\n  file3   |    4 ++++\n- 3 files changed, 9 insertions(+), 0 deletions(-)\n+ 3 files changed, 9 insertions(+)\n $\ndiff --git a/t/t4013/diff.whatchanged_--patch-with-stat_--summary_master_--_dir_ b/t/t4013/diff.whatchanged_--patch-with-stat_--summary_master_--_dir_\nindex 6a467cc..16ae543 100644\n--- a/t/t4013/diff.whatchanged_--patch-with-stat_--summary_master_--_dir_\n+++ b/t/t4013/diff.whatchanged_--patch-with-stat_--summary_master_--_dir_\n@@ -6,7 +6,7 @@ Date:   Mon Jun 26 00:03:00 2006 +0000\n     Side\n ---\n  dir/sub |    2 ++\n- 1 files changed, 2 insertions(+), 0 deletions(-)\n+ 1 file changed, 2 insertions(+)\n \n diff --git a/dir/sub b/dir/sub\n index 35d242b..7289e35 100644\n@@ -25,7 +25,7 @@ Date:   Mon Jun 26 00:02:00 2006 +0000\n     Third\n ---\n  dir/sub |    2 ++\n- 1 files changed, 2 insertions(+), 0 deletions(-)\n+ 1 file changed, 2 insertions(+)\n \n diff --git a/dir/sub b/dir/sub\n index 8422d40..cead32e 100644\n@@ -47,7 +47,7 @@ Date:   Mon Jun 26 00:01:00 2006 +0000\n     This is the second commit.\n ---\n  dir/sub |    2 ++\n- 1 files changed, 2 insertions(+), 0 deletions(-)\n+ 1 file changed, 2 insertions(+)\n \n diff --git a/dir/sub b/dir/sub\n index 35d242b..8422d40 100644\ndiff --git a/t/t4013/diff.whatchanged_--patch-with-stat_master b/t/t4013/diff.whatchanged_--patch-with-stat_master\nindex 1e1bbe1..f3e45ec 100644\n--- a/t/t4013/diff.whatchanged_--patch-with-stat_master\n+++ b/t/t4013/diff.whatchanged_--patch-with-stat_master\n@@ -8,7 +8,7 @@ Date:   Mon Jun 26 00:03:00 2006 +0000\n  dir/sub |    2 ++\n  file0   |    3 +++\n  file3   |    4 ++++\n- 3 files changed, 9 insertions(+), 0 deletions(-)\n+ 3 files changed, 9 insertions(+)\n \n diff --git a/dir/sub b/dir/sub\n index 35d242b..7289e35 100644\n@@ -49,7 +49,7 @@ Date:   Mon Jun 26 00:02:00 2006 +0000\n ---\n  dir/sub |    2 ++\n  file1   |    3 +++\n- 2 files changed, 5 insertions(+), 0 deletions(-)\n+ 2 files changed, 5 insertions(+)\n \n diff --git a/dir/sub b/dir/sub\n index 8422d40..cead32e 100644\ndiff --git a/t/t4013/diff.whatchanged_--patch-with-stat_master_--_dir_ b/t/t4013/diff.whatchanged_--patch-with-stat_master_--_dir_\nindex 13789f1..c77f0bc 100644\n--- a/t/t4013/diff.whatchanged_--patch-with-stat_master_--_dir_\n+++ b/t/t4013/diff.whatchanged_--patch-with-stat_master_--_dir_\n@@ -6,7 +6,7 @@ Date:   Mon Jun 26 00:03:00 2006 +0000\n     Side\n ---\n  dir/sub |    2 ++\n- 1 files changed, 2 insertions(+), 0 deletions(-)\n+ 1 file changed, 2 insertions(+)\n \n diff --git a/dir/sub b/dir/sub\n index 35d242b..7289e35 100644\n@@ -25,7 +25,7 @@ Date:   Mon Jun 26 00:02:00 2006 +0000\n     Third\n ---\n  dir/sub |    2 ++\n- 1 files changed, 2 insertions(+), 0 deletions(-)\n+ 1 file changed, 2 insertions(+)\n \n diff --git a/dir/sub b/dir/sub\n index 8422d40..cead32e 100644\n@@ -47,7 +47,7 @@ Date:   Mon Jun 26 00:01:00 2006 +0000\n     This is the second commit.\n ---\n  dir/sub |    2 ++\n- 1 files changed, 2 insertions(+), 0 deletions(-)\n+ 1 file changed, 2 insertions(+)\n \n diff --git a/dir/sub b/dir/sub\n index 35d242b..8422d40 100644\ndiff --git a/t/t4013/diff.whatchanged_--root_--cc_--patch-with-stat_--summary_master b/t/t4013/diff.whatchanged_--root_--cc_--patch-with-stat_--summary_master\nindex e96ff1f..8d03efe 100644\n--- a/t/t4013/diff.whatchanged_--root_--cc_--patch-with-stat_--summary_master\n+++ b/t/t4013/diff.whatchanged_--root_--cc_--patch-with-stat_--summary_master\n@@ -8,7 +8,7 @@ Date:   Mon Jun 26 00:04:00 2006 +0000\n \n  dir/sub |    2 ++\n  file0   |    3 +++\n- 2 files changed, 5 insertions(+), 0 deletions(-)\n+ 2 files changed, 5 insertions(+)\n \n diff --cc dir/sub\n index cead32e,7289e35..992913c\n@@ -47,7 +47,7 @@ Date:   Mon Jun 26 00:03:00 2006 +0000\n  dir/sub |    2 ++\n  file0   |    3 +++\n  file3   |    4 ++++\n- 3 files changed, 9 insertions(+), 0 deletions(-)\n+ 3 files changed, 9 insertions(+)\n  create mode 100644 file3\n \n diff --git a/dir/sub b/dir/sub\n@@ -89,7 +89,7 @@ Date:   Mon Jun 26 00:02:00 2006 +0000\n ---\n  dir/sub |    2 ++\n  file1   |    3 +++\n- 2 files changed, 5 insertions(+), 0 deletions(-)\n+ 2 files changed, 5 insertions(+)\n  create mode 100644 file1\n \n diff --git a/dir/sub b/dir/sub\n@@ -165,7 +165,7 @@ Date:   Mon Jun 26 00:00:00 2006 +0000\n  dir/sub |    2 ++\n  file0   |    3 +++\n  file2   |    3 +++\n- 3 files changed, 8 insertions(+), 0 deletions(-)\n+ 3 files changed, 8 insertions(+)\n  create mode 100644 dir/sub\n  create mode 100644 file0\n  create mode 100644 file2\ndiff --git a/t/t4013/diff.whatchanged_--root_--patch-with-stat_--summary_master b/t/t4013/diff.whatchanged_--root_--patch-with-stat_--summary_master\nindex 0291153..1874d06 100644\n--- a/t/t4013/diff.whatchanged_--root_--patch-with-stat_--summary_master\n+++ b/t/t4013/diff.whatchanged_--root_--patch-with-stat_--summary_master\n@@ -8,7 +8,7 @@ Date:   Mon Jun 26 00:03:00 2006 +0000\n  dir/sub |    2 ++\n  file0   |    3 +++\n  file3   |    4 ++++\n- 3 files changed, 9 insertions(+), 0 deletions(-)\n+ 3 files changed, 9 insertions(+)\n  create mode 100644 file3\n \n diff --git a/dir/sub b/dir/sub\n@@ -50,7 +50,7 @@ Date:   Mon Jun 26 00:02:00 2006 +0000\n ---\n  dir/sub |    2 ++\n  file1   |    3 +++\n- 2 files changed, 5 insertions(+), 0 deletions(-)\n+ 2 files changed, 5 insertions(+)\n  create mode 100644 file1\n \n diff --git a/dir/sub b/dir/sub\n@@ -126,7 +126,7 @@ Date:   Mon Jun 26 00:00:00 2006 +0000\n  dir/sub |    2 ++\n  file0   |    3 +++\n  file2   |    3 +++\n- 3 files changed, 8 insertions(+), 0 deletions(-)\n+ 3 files changed, 8 insertions(+)\n  create mode 100644 dir/sub\n  create mode 100644 file0\n  create mode 100644 file2\ndiff --git a/t/t4013/diff.whatchanged_--root_--patch-with-stat_master b/t/t4013/diff.whatchanged_--root_--patch-with-stat_master\nindex 9b0349c..5211ff2 100644\n--- a/t/t4013/diff.whatchanged_--root_--patch-with-stat_master\n+++ b/t/t4013/diff.whatchanged_--root_--patch-with-stat_master\n@@ -8,7 +8,7 @@ Date:   Mon Jun 26 00:03:00 2006 +0000\n  dir/sub |    2 ++\n  file0   |    3 +++\n  file3   |    4 ++++\n- 3 files changed, 9 insertions(+), 0 deletions(-)\n+ 3 files changed, 9 insertions(+)\n \n diff --git a/dir/sub b/dir/sub\n index 35d242b..7289e35 100644\n@@ -49,7 +49,7 @@ Date:   Mon Jun 26 00:02:00 2006 +0000\n ---\n  dir/sub |    2 ++\n  file1   |    3 +++\n- 2 files changed, 5 insertions(+), 0 deletions(-)\n+ 2 files changed, 5 insertions(+)\n \n diff --git a/dir/sub b/dir/sub\n index 8422d40..cead32e 100644\n@@ -123,7 +123,7 @@ Date:   Mon Jun 26 00:00:00 2006 +0000\n  dir/sub |    2 ++\n  file0   |    3 +++\n  file2   |    3 +++\n- 3 files changed, 8 insertions(+), 0 deletions(-)\n+ 3 files changed, 8 insertions(+)\n \n diff --git a/dir/sub b/dir/sub\n new file mode 100644\ndiff --git a/t/t4013/diff.whatchanged_--root_-c_--patch-with-stat_--summary_master b/t/t4013/diff.whatchanged_--root_-c_--patch-with-stat_--summary_master\nindex c0aff68..ad30245 100644\n--- a/t/t4013/diff.whatchanged_--root_-c_--patch-with-stat_--summary_master\n+++ b/t/t4013/diff.whatchanged_--root_-c_--patch-with-stat_--summary_master\n@@ -8,7 +8,7 @@ Date:   Mon Jun 26 00:04:00 2006 +0000\n \n  dir/sub |    2 ++\n  file0   |    3 +++\n- 2 files changed, 5 insertions(+), 0 deletions(-)\n+ 2 files changed, 5 insertions(+)\n \n diff --combined dir/sub\n index cead32e,7289e35..992913c\n@@ -47,7 +47,7 @@ Date:   Mon Jun 26 00:03:00 2006 +0000\n  dir/sub |    2 ++\n  file0   |    3 +++\n  file3   |    4 ++++\n- 3 files changed, 9 insertions(+), 0 deletions(-)\n+ 3 files changed, 9 insertions(+)\n  create mode 100644 file3\n \n diff --git a/dir/sub b/dir/sub\n@@ -89,7 +89,7 @@ Date:   Mon Jun 26 00:02:00 2006 +0000\n ---\n  dir/sub |    2 ++\n  file1   |    3 +++\n- 2 files changed, 5 insertions(+), 0 deletions(-)\n+ 2 files changed, 5 insertions(+)\n  create mode 100644 file1\n \n diff --git a/dir/sub b/dir/sub\n@@ -165,7 +165,7 @@ Date:   Mon Jun 26 00:00:00 2006 +0000\n  dir/sub |    2 ++\n  file0   |    3 +++\n  file2   |    3 +++\n- 3 files changed, 8 insertions(+), 0 deletions(-)\n+ 3 files changed, 8 insertions(+)\n  create mode 100644 dir/sub\n  create mode 100644 file0\n  create mode 100644 file2\ndiff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh\nindex 6797512..7dfe716 100755\n--- a/t/t4014-format-patch.sh\n+++ b/t/t4014-format-patch.sh\n@@ -520,7 +520,7 @@ test_expect_success 'shortlog of cover-letter wraps overly-long onelines' '\n cat > expect << EOF\n ---\n  file |   16 ++++++++++++++++\n- 1 files changed, 16 insertions(+), 0 deletions(-)\n+ 1 file changed, 16 insertions(+)\n \n diff --git a/file b/file\n index 40f36c6..2dc5c23 100644\ndiff --git a/t/t4030-diff-textconv.sh b/t/t4030-diff-textconv.sh\nindex 88c5619..4ac162c 100755\n--- a/t/t4030-diff-textconv.sh\n+++ b/t/t4030-diff-textconv.sh\n@@ -86,7 +86,7 @@ test_expect_success 'status -v produces text' '\n \n cat >expect.stat <<'EOF'\n  file |  Bin 2 -> 4 bytes\n- 1 files changed, 0 insertions(+), 0 deletions(-)\n+ 1 file changed, 0 insertions(+), 0 deletions(-)\n EOF\n test_expect_success 'diffstat does not run textconv' '\n \techo file diff=fail >.gitattributes &&\ndiff --git a/t/t4045-diff-relative.sh b/t/t4045-diff-relative.sh\nindex 8a3c63b..bd119be 100755\n--- a/t/t4045-diff-relative.sh\n+++ b/t/t4045-diff-relative.sh\n@@ -33,7 +33,7 @@ check_stat() {\n expect=$1; shift\n cat >expected <<EOF\n  $expect |    1 +\n- 1 files changed, 1 insertions(+), 0 deletions(-)\n+ 1 file changed, 1 insertion(+)\n EOF\n test_expect_success \"--stat $*\" \"\n \tgit diff --stat $* HEAD^ >actual &&\ndiff --git a/t/t4049-diff-stat-count.sh b/t/t4049-diff-stat-count.sh\nindex 641e70d..a6d1887 100755\n--- a/t/t4049-diff-stat-count.sh\n+++ b/t/t4049-diff-stat-count.sh\n@@ -16,7 +16,7 @@ test_expect_success setup '\n \tcat >expect <<-\\EOF\n \t a |    1 +\n \t b |    1 +\n-\t 2 files changed, 2 insertions(+), 0 deletions(-)\n+\t 2 files changed, 2 insertions(+)\n \tEOF\n \tgit diff --stat --stat-count=2 >actual &&\n \ttest_cmp expect actual\ndiff --git a/t/t4100/t-apply-8.expect b/t/t4100/t-apply-8.expect\nindex eef7f2e..55a55c3 100644\n--- a/t/t4100/t-apply-8.expect\n+++ b/t/t4100/t-apply-8.expect\n@@ -1,2 +1,2 @@\n  t/t4100-apply-stat.sh |    2 +-\n- 1 files changed, 1 insertions(+), 1 deletions(-)\n+ 1 file changed, 1 insertion(+), 1 deletion(-)\ndiff --git a/t/t4100/t-apply-9.expect b/t/t4100/t-apply-9.expect\nindex eef7f2e..55a55c3 100644\n--- a/t/t4100/t-apply-9.expect\n+++ b/t/t4100/t-apply-9.expect\n@@ -1,2 +1,2 @@\n  t/t4100-apply-stat.sh |    2 +-\n- 1 files changed, 1 insertions(+), 1 deletions(-)\n+ 1 file changed, 1 insertion(+), 1 deletion(-)\ndiff --git a/t/t5150-request-pull.sh b/t/t5150-request-pull.sh\nindex da25bc2..34c482f 100755\n--- a/t/t5150-request-pull.sh\n+++ b/t/t5150-request-pull.sh\n@@ -95,7 +95,7 @@ test_expect_success 'setup: two scripts for reading pull requests' '\n \tb\n \t: diffstat\n \tn\n-\t/ [0-9]* files changed/ {\n+\t/ [0-9]* files\\? changed/ {\n \t\ta\\\\\n \tDIFFSTAT\n \t\tb\ndiff --git a/t/t7602-merge-octopus-many.sh b/t/t7602-merge-octopus-many.sh\nindex 61f36ba..5783ebf 100755\n--- a/t/t7602-merge-octopus-many.sh\n+++ b/t/t7602-merge-octopus-many.sh\n@@ -57,7 +57,7 @@ Merge made by the 'octopus' strategy.\n  c2.c |    1 +\n  c3.c |    1 +\n  c4.c |    1 +\n- 3 files changed, 3 insertions(+), 0 deletions(-)\n+ 3 files changed, 3 insertions(+)\n  create mode 100644 c2.c\n  create mode 100644 c3.c\n  create mode 100644 c4.c\n@@ -74,7 +74,7 @@ Already up-to-date with c4\n Trying simple merge with c5\n Merge made by the 'octopus' strategy.\n  c5.c |    1 +\n- 1 files changed, 1 insertions(+), 0 deletions(-)\n+ 1 file changed, 1 insertion(+)\n  create mode 100644 c5.c\n EOF\n \n@@ -89,7 +89,7 @@ Trying simple merge with c2\n Merge made by the 'octopus' strategy.\n  c1.c |    1 +\n  c2.c |    1 +\n- 2 files changed, 2 insertions(+), 0 deletions(-)\n+ 2 files changed, 2 insertions(+)\n  create mode 100644 c1.c\n  create mode 100644 c2.c\n EOF\n-- \n1.7.8.36.g69ee2\n"},{"id":"183498","messageId":"7vhaza2qjw.fsf@alter.siamese.dyndns.org","threadId":"29489","inReplyTo":"1328100907-20397-1-git-send-email-pclouds@gmail.com","subject":"Re: [PATCH v2] Use correct grammar in diffstat summary line","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-02-01T21:26:43Z","receivedAt":"2012-02-01T21:26:43Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Nice.  Will queue with a minor update to the log message:\n\ncommit 3f29ab34372ee11946439da3bde307eb90ad9031\nAuthor: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\nDate:   Wed Feb 1 19:55:07 2012 +0700\n\n    Use correct grammar in diffstat summary line\n    \n    \"git diff --stat\" and \"git apply --stat\" now learn to print the line\n    \"%d files changed, %d insertions(+), %d deletions(-)\" in singular form\n    whenever applicable. \"0 insertions\" and \"0 deletions\" are also omitted\n    unless they are both zero.\n    \n    This matches how versions of \"diffstat\" that are not prehistoric produced\n    their output, and also makes this line translatable.\n    \n    [jc: with help from Thomas Dickey in archaeology of \"diffstat\"]\n    \n    Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n    Signed-off-by: Junio C Hamano <gitster@pobox.com>\n\nAnd also this bit on top:\n\ndiff --git a/diff.c b/diff.c\nindex 5c31b36..5f3ce97 100644\n--- a/diff.c\n+++ b/diff.c\n@@ -1329,7 +1329,7 @@ int print_stat_summary(FILE *fp, int files, int insertions, int deletions)\n \n \tif (!files) {\n \t\tassert(insertions == 0 && deletions == 0);\n-\t\treturn fputs(_(\" no changes\\n\"), fp);\n+\t\treturn fputs(_(\" 0 files changed\\n\"), fp);\n \t}\n \n \tstrbuf_addf(&sb,\n"},{"id":"183515","messageId":"20120201233515.GC29599@burratino","threadId":"29489","inReplyTo":"1328100907-20397-1-git-send-email-pclouds@gmail.com","subject":"Re: [PATCH v2] Use correct grammar in diffstat summary line","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2012-02-01T23:35:15Z","receivedAt":"2012-02-01T23:35:15Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"(dropping Thomas from cc)\nNguyễn Thái Ngọc Duy wrote:\n\n>  And this patch's diffstat looks just scary due to test suite's updates.\n\nNot about this patch, but: let's see if we can chisel away at that.\n\nHidden below are also two minor bug reports about the patch.  See (*)\nand (**) below.\n\n> --- a/t/t0023-crlf-am.sh\n> +++ b/t/t0023-crlf-am.sh\n> @@ -12,7 +12,7 @@ Subject: test1\n>  \n>  ---\n>   foo |    1 +\n> - 1 files changed, 1 insertions(+), 0 deletions(-)\n> + 1 file changed, 1 insertion(+)\n>   create mode 100644 foo\n\nThis patchfile is sample input to \"git am\", and this patch hunk\nchanges it to match the modified format-patch output format.  But\ndon't we want \"git am\" to work with old patches, too?  So this hunk is\nunnecessary.\n\n[...]\n> --- a/t/t1200-tutorial.sh\n> +++ b/t/t1200-tutorial.sh\n> @@ -156,7 +156,7 @@ Updating VARIABLE..VARIABLE\n>  FASTFORWARD (no commit created; -m option ignored)\n>   example |    1 +\n>   hello   |    1 +\n> - 2 files changed, 2 insertions(+), 0 deletions(-)\n> + 2 files changed, 2 insertions(+)\n>  EOF\n\nYes, this one's necessary.\n\n(*) It's reminding us to update the gitcore-tutorial. :)\n\n[...]\n> --- a/t/t3300-funny-names.sh\n> +++ b/t/t3300-funny-names.sh\n> @@ -167,7 +167,7 @@ test_expect_success TABS_IN_FILENAMES 'git diff-tree delete with-funny' \\\n>  test_expect_success TABS_IN_FILENAMES 'setup expect' '\n>  cat >expected <<\\EOF\n>   \"tabs\\t,\\\" (dq) and spaces\"\n> - 1 files changed, 0 insertions(+), 0 deletions(-)\n> + 1 file changed, 0 insertions(+), 0 deletions(-)\n>  EOF\n>  '\n\nI'm not sure why this and other tests in the same file use \"git apply\n--stat\" to check their work.  The descriptions refer to diff-tree but\nthe tests themselves use diff-index | apply --stat.  Puzzling.\n\n[...]\n> --- a/t/t3508-cherry-pick-many-commits.sh\n> +++ b/t/t3508-cherry-pick-many-commits.sh\n> @@ -38,13 +38,13 @@ test_expect_success 'cherry-pick first..fourth works' '\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 1 file changed, 1 insertion(+)\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 1 file changed, 1 insertion(+)\n>  \t[master OBJID] fourth\n>  \t Author: A U Thor <author@example.com>\n> -\t 1 files changed, 1 insertions(+), 0 deletions(-)\n> +\t 1 file changed, 1 insertion(+)\n>  \tEOF\n\nProbably should be split out as a separate test so cherry-pick's\nbehavior and progress reporting can be tested separately.  Aside from\nthat detail, makes sense.\n\n[...]\n> --- a/t/t3903-stash.sh\n> +++ b/t/t3903-stash.sh\n> @@ -444,7 +444,7 @@ test_expect_success 'stash show - stashes on stack, stash-like argument' '\n>  \tgit reset --hard &&\n>  \tcat >expected <<-EOF &&\n>  \t file |    1 +\n> -\t 1 files changed, 1 insertions(+), 0 deletions(-)\n> +\t 1 file changed, 1 insertion(+)\n\nHm.  \"git stash show\" defaults to --stat, but these tests are not\nreally about that.  Maybe there should be one test that checks that\nthe default uses --stat and others could use --numstat or similar?\n\nThis will be a problem with GETTEXT_POISON (except your patch bypasses\npoison so it got missed --- will send a relevant fix as a reply).\n\n[...]\n> +++ b/t/t4013/diff.diff-tree_--cc_--patch-with-stat_--summary_master\n> +++ b/t/t4013/diff.diff-tree_--cc_--patch-with-stat_--summary_side\n> +++ b/t/t4013/diff.diff-tree_--cc_--patch-with-stat_master\n> +++ b/t/t4013/diff.diff-tree_--cc_--stat_--summary_master\n[...]\n> +++ b/t/t4013/diff.format-patch_--attach_--stdout_initial..side\n> +++ b/t/t4013/diff.format-patch_--inline_--stdout_--numbered-files_initial..master\n> +++ b/t/t4013/diff.format-patch_--inline_--stdout_--subject-prefix=TESTCASE_initial..master\n[...]\n\nTesting the --stat option.  Can't really be avoided.  (Though maybe\nsome more modular tests for these combinations can be made some day.)\n\n[...]\n> --- a/t/t4014-format-patch.sh\n> +++ b/t/t4014-format-patch.sh\n> @@ -520,7 +520,7 @@ test_expect_success 'shortlog of cover-letter wraps overly-long onelines' '\n>  cat > expect << EOF\n>  ---\n>   file |   16 ++++++++++++++++\n> - 1 files changed, 16 insertions(+), 0 deletions(-)\n> + 1 file changed, 16 insertions(+)\n\nNot relevant to the detail being tested, should probably be fuzzed\nout.\n\n[...]\n> --- a/t/t4030-diff-textconv.sh\n> +++ b/t/t4030-diff-textconv.sh\n> @@ -86,7 +86,7 @@ test_expect_success 'status -v produces text' '\n>  \n>  cat >expect.stat <<'EOF'\n>   file |  Bin 2 -> 4 bytes\n> - 1 files changed, 0 insertions(+), 0 deletions(-)\n> + 1 file changed, 0 insertions(+), 0 deletions(-)\n>  EOF\n>  test_expect_success 'diffstat does not run textconv' '\n>  \techo file diff=fail >.gitattributes &&\n\nTesting diffstat.  Would be nice to have an accompanying test of\nnumstat.\n\n[...]\n> --- a/t/t4045-diff-relative.sh\n> +++ b/t/t4045-diff-relative.sh\n> @@ -33,7 +33,7 @@ check_stat() {\n>  expect=$1; shift\n>  cat >expected <<EOF\n>   $expect |    1 +\n> - 1 files changed, 1 insertions(+), 0 deletions(-)\n> + 1 file changed, 1 insertion(+)\n>  EOF\n\nNot the detail being tested, so technically it would be nicer to\nfuzz the last line out.\n\n[...]\n> --- a/t/t4049-diff-stat-count.sh\n> +++ b/t/t4049-diff-stat-count.sh\n> @@ -16,7 +16,7 @@ test_expect_success setup '\n>  \tcat >expect <<-\\EOF\n>  \t a |    1 +\n>  \t b |    1 +\n> -\t 2 files changed, 2 insertions(+), 0 deletions(-)\n> +\t 2 files changed, 2 insertions(+)\n>  \tEOF\n>  \tgit diff --stat --stat-count=2 >actual &&\n>  \ttest_cmp expect actual\n\nTesting diffstat.  Looks sane.\n\n[...]\n> +++ b/t/t4100/t-apply-8.expect\n> @@ -1,2 +1,2 @@\n>   t/t4100-apply-stat.sh |    2 +-\n> - 1 files changed, 1 insertions(+), 1 deletions(-)\n> + 1 file changed, 1 insertion(+), 1 deletion(-)\n[...]\n> +++ b/t/t4100/t-apply-9.expect\n> @@ -1,2 +1,2 @@\n>   t/t4100-apply-stat.sh |    2 +-\n> - 1 files changed, 1 insertions(+), 1 deletions(-)\n> + 1 file changed, 1 insertion(+), 1 deletion(-)\n\nTesting apply --stat.  Tests of apply --numstat would be more\ninteresting, but then we'd still need some tests like these to make\nsure --stat is consistent with it, so it still seems sane.\n\n> --- a/t/t5150-request-pull.sh\n> +++ b/t/t5150-request-pull.sh\n> @@ -95,7 +95,7 @@ test_expect_success 'setup: two scripts for reading pull requests' '\n>  \tb\n>  \t: diffstat\n>  \tn\n> -\t/ [0-9]* files changed/ {\n> +\t/ [0-9]* files\\? changed/ {\n\nMimicking a human.\n\n(**) Should probably use \"*\" instead of \\? --- \\? is a GNU extension,\nnot a BRE.\n\n[...]\n> +++ b/t/t7602-merge-octopus-many.sh\n> @@ -57,7 +57,7 @@ Merge made by the 'octopus' strategy.\n>   c2.c |    1 +\n>   c3.c |    1 +\n>   c4.c |    1 +\n> - 3 files changed, 3 insertions(+), 0 deletions(-)\n> + 3 files changed, 3 insertions(+)\n>   create mode 100644 c2.c\n>   create mode 100644 c3.c\n>   create mode 100644 c4.c\n\nTest is about the \"Trying simple merge with\" lines, not the final\ndiffstat summary.  Should probably be fuzzed out.\n\nThanks, that was interesting.\n\nJonathan\n"},{"id":"183520","messageId":"20120202002053.GD29599@burratino","threadId":"29489","inReplyTo":"20120201233515.GC29599@burratino","subject":"[RFC/PATCH] i18n: do not define gettext/ngettext in NO_GETTEXT case","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2012-02-02T00:20:53Z","receivedAt":"2012-02-02T00:20:53Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"gettext.h is responsible for defining the _ and  Q_ helpers which are\neither simple stubs (in the NO_GETTEXT case) or synonyms for the\nlibintl functions used to translated git output.  As an implementation\nartifact, ever since the !NO_GETTEXT case was implemented\n(v1.7.9-rc0~42^2, 2011-11-18), they have also defined gettext and\nngettext macros in the NO_GETTEXT case:\n\n\t#ifdef gettext\n\t# undef gettext\n\t#endif\n\t#define gettext(x) (x)\n\nNew readers looking at this header might be tempted to use gettext and\nngettext directly, since they are defined in all cases, instead of\nusing the _ and Q_ wrappers which look like shortcuts.\n\nHowever gettext and ngettext bypass the GETTEXT_POISON feature.  So\nany code using them directly will produce perfectly sensible English\noutput when run in the test suite with GETTEXT_POISON set, instead of\nthe poison markers that normally would make it easy to catch output\nintended for machines that has been marked for translation by mistake.\n\nAvoid the temptation by _not_ providing fallback definitions for\ngettext and ngettext ourselves.  This way, the header is less\nmisleading and code that uses gettext et al directly will fail to\ncompile when NO_GETTEXT is set so we can catch it early.\n\nWe also take the opportunity to avoid a little ifdef-ery by splitting\nthe NO_GETTEXT and !NO_GETTEXT implementations into different headers.\nUnfortunately this involves some duplication of code.\n\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\nJonathan Nieder wrote:\n\n> This will be a problem with GETTEXT_POISON (except your patch bypasses\n> poison so it got missed --- will send a relevant fix as a reply).\n\nHere's a rough patch to make that kind of thing easier to catch.  It\nmight make more sense to do\n\n\t#ifdef NO_GETTEXT\n\t#define git_gettext_(x) (x)\n\t#define git_ngettext_(msgid, plu, n) ...\n\t#else\n\t#define git_gettext_(x) gettext(x)\n\t#define git_ngettext_(msgid, plu, n) ngettext(msgid, plu, n)\n\t#endif\n\n\tstatic inline const char *_(const char *msgid)\n\t{\n\t\treturn poisoning() ? \"poison!\" : git_gettext_(msgid);\n\t}\n\t...\n\nbut I didn't think of it until I had already written this patch.\nAnyway, this way you get both approaches for easy comparison. ;-)\n\n Makefile          |    3 +++\n gettext-libintl.h |   26 ++++++++++++++++++++++++++\n gettext-noop.h    |   30 ++++++++++++++++++++++++++++++\n gettext.h         |   53 +++--------------------------------------------------\n git-compat-util.h |    6 ++++++\n 5 files changed, 68 insertions(+), 50 deletions(-)\n create mode 100644 gettext-libintl.h\n create mode 100644 gettext-noop.h\n\ndiff --git a/Makefile b/Makefile\nindex c457c34f..83e8c0f1 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -1525,6 +1525,9 @@ endif\n ifdef NO_GETTEXT\n \tBASIC_CFLAGS += -DNO_GETTEXT\n \tUSE_GETTEXT_SCHEME ?= fallthrough\n+\tLIB_H += gettext-noop.h\n+else\n+\tLIB_H += gettext-libintl.h\n endif\n ifdef NO_STRCASESTR\n \tCOMPAT_CFLAGS += -DNO_STRCASESTR\ndiff --git a/gettext-libintl.h b/gettext-libintl.h\nnew file mode 100644\nindex 00000000..c9199703\n--- /dev/null\n+++ b/gettext-libintl.h\n@@ -0,0 +1,26 @@\n+#ifndef GETTEXT_LIBINTL_H\n+#define GETTEXT_LIBINTL_H\n+\n+#include <libintl.h>\n+\n+#define FORMAT_PRESERVING(n) __attribute__((format_arg(n)))\n+\n+extern void git_setup_gettext(void);\n+\n+static inline FORMAT_PRESERVING(1) const char *_(const char *msgid)\n+{\n+\treturn use_gettext_poison() ? \"# GETTEXT POISON #\" : gettext(msgid);\n+}\n+\n+static inline FORMAT_PRESERVING(1) FORMAT_PRESERVING(2)\n+const char *Q_(const char *msgid, const char *plu, unsigned long n)\n+{\n+\tif (use_gettext_poison())\n+\t\treturn \"# GETTEXT POISON #\";\n+\treturn ngettext(msgid, plu, n);\n+}\n+\n+/* Mark msgid for translation but do not translate it. */\n+#define N_(msgid) msgid\n+\n+#endif\ndiff --git a/gettext-noop.h b/gettext-noop.h\nnew file mode 100644\nindex 00000000..28843a61\n--- /dev/null\n+++ b/gettext-noop.h\n@@ -0,0 +1,30 @@\n+/*\n+ * Copyright (c) 2010-2011 Ævar Arnfjörð Bjarmason\n+ *\n+ * This is a skeleton no-op implementation of gettext for Git.\n+ */\n+\n+#ifndef GETTEXT_NOOP_H\n+#define GETTEXT_NOOP_H\n+\n+#define FORMAT_PRESERVING(n) __attribute__((format_arg(n)))\n+\n+static inline void git_setup_gettext(void) { }\n+\n+static inline FORMAT_PRESERVING(1) const char *_(const char *msgid)\n+{\n+\treturn use_gettext_poison() ? \"# GETTEXT POISON #\" : msgid;\n+}\n+\n+static inline FORMAT_PRESERVING(1) FORMAT_PRESERVING(2)\n+const char *Q_(const char *msgid, const char *plu, unsigned long n)\n+{\n+\tif (use_gettext_poison())\n+\t\treturn \"# GETTEXT POISON #\";\n+\treturn n == 1 ? msgid : plu;\n+}\n+\n+/* Mark msgid for translation but do not translate it. */\n+#define N_(msgid) msgid\n+\n+#endif\ndiff --git a/gettext.h b/gettext.h\nindex 57ba8bb0..9bc67243 100644\n--- a/gettext.h\n+++ b/gettext.h\n@@ -1,11 +1,3 @@\n-/*\n- * Copyright (c) 2010-2011 Ævar Arnfjörð Bjarmason\n- *\n- * This is a skeleton no-op implementation of gettext for Git.\n- * You can replace it with something that uses libintl.h and wraps\n- * gettext() to try out the translations.\n- */\n-\n #ifndef GETTEXT_H\n #define GETTEXT_H\n \n@@ -13,49 +5,10 @@\n #error \"namespace conflict: '_' or 'Q_' is pre-defined?\"\n #endif\n \n-#ifndef NO_GETTEXT\n-#\tinclude <libintl.h>\n+#ifdef NO_GETTEXT\n+#include \"gettext-noop.h\"\n #else\n-#\tifdef gettext\n-#\t\tundef gettext\n-#\tendif\n-#\tdefine gettext(s) (s)\n-#\tifdef ngettext\n-#\t\tundef ngettext\n-#\tendif\n-#\tdefine ngettext(s, p, n) ((n == 1) ? (s) : (p))\n+#include \"gettext-libintl.h\"\n #endif\n \n-#define FORMAT_PRESERVING(n) __attribute__((format_arg(n)))\n-\n-#ifndef NO_GETTEXT\n-extern void git_setup_gettext(void);\n-#else\n-static inline void git_setup_gettext(void)\n-{\n-}\n-#endif\n-\n-#ifdef GETTEXT_POISON\n-extern int use_gettext_poison(void);\n-#else\n-#define use_gettext_poison() 0\n-#endif\n-\n-static inline FORMAT_PRESERVING(1) const char *_(const char *msgid)\n-{\n-\treturn use_gettext_poison() ? \"# GETTEXT POISON #\" : gettext(msgid);\n-}\n-\n-static inline FORMAT_PRESERVING(1) FORMAT_PRESERVING(2)\n-const char *Q_(const char *msgid, const char *plu, unsigned long n)\n-{\n-\tif (use_gettext_poison())\n-\t\treturn \"# GETTEXT POISON #\";\n-\treturn ngettext(msgid, plu, n);\n-}\n-\n-/* Mark msgid for translation but do not translate it. */\n-#define N_(msgid) msgid\n-\n #endif\ndiff --git a/git-compat-util.h b/git-compat-util.h\nindex 8f3972cd..ca4a4f19 100644\n--- a/git-compat-util.h\n+++ b/git-compat-util.h\n@@ -236,6 +236,12 @@ extern char *gitbasename(char *);\n #endif\n #endif\n \n+#ifdef GETTEXT_POISON\n+extern int use_gettext_poison(void);\n+#else\n+#define use_gettext_poison() 0\n+#endif\n+\n #include \"compat/bswap.h\"\n \n /* General helper functions */\n-- \n1.7.9\n"},{"id":"183522","messageId":"20120202002757.GA3487@burratino","threadId":"29489","inReplyTo":"20120201233515.GC29599@burratino","subject":"Re: [PATCH v2] Use correct grammar in diffstat summary line","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2012-02-02T00:27:58Z","receivedAt":"2012-02-02T00:27:58Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Jonathan Nieder wrote:\n\n> [...]\n>> --- a/t/t1200-tutorial.sh\n>> +++ b/t/t1200-tutorial.sh\n>> @@ -156,7 +156,7 @@ Updating VARIABLE..VARIABLE\n>>  FASTFORWARD (no commit created; -m option ignored)\n>>   example |    1 +\n>>   hello   |    1 +\n>> - 2 files changed, 2 insertions(+), 0 deletions(-)\n>> + 2 files changed, 2 insertions(+)\n>>  EOF\n>\n> Yes, this one's necessary.\n>\n> (*) It's reminding us to update the gitcore-tutorial. :)\n\nPatch for squashing (untested) below.\n\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\n Documentation/gitcore-tutorial.txt |    2 +-\n Documentation/gittutorial-2.txt    |    4 ++--\n 2 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/Documentation/gitcore-tutorial.txt b/Documentation/gitcore-tutorial.txt\nindex c27d086f..fb0d5692 100644\n--- a/Documentation/gitcore-tutorial.txt\n+++ b/Documentation/gitcore-tutorial.txt\n@@ -1004,7 +1004,7 @@ Updating from ae3a2da... to a80b4aa....\n Fast-forward (no commit created; -m option ignored)\n  example |    1 +\n  hello   |    1 +\n- 2 files changed, 2 insertions(+), 0 deletions(-)\n+ 2 files changed, 2 insertions(+)\n ----------------\n \n Because your branch did not contain anything more than what had\ndiff --git a/Documentation/gittutorial-2.txt b/Documentation/gittutorial-2.txt\nindex f1e4422a..e00a4d21 100644\n--- a/Documentation/gittutorial-2.txt\n+++ b/Documentation/gittutorial-2.txt\n@@ -34,12 +34,12 @@ $ echo 'hello world' > file.txt\n $ git add .\n $ git commit -a -m \"initial commit\"\n [master (root-commit) 54196cc] initial commit\n- 1 files changed, 1 insertions(+), 0 deletions(-)\n+ 1 file changed, 1 insertion(+)\n  create mode 100644 file.txt\n $ echo 'hello world!' >file.txt\n $ git commit -a -m \"add emphasis\"\n [master c4d59f3] add emphasis\n- 1 files changed, 1 insertions(+), 1 deletions(-)\n+ 1 file changed, 1 insertion(+), 1 deletion(-)\n ------------------------------------------------\n \n What are the 7 digits of hex that git responded to the commit with?\n-- \n1.7.9\n"},{"id":"183523","messageId":"20120202003118.GB3487@burratino","threadId":"29489","inReplyTo":"20120201233515.GC29599@burratino","subject":"Re: [PATCH v2] Use correct grammar in diffstat summary line","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2012-02-02T00:31:18Z","receivedAt":"2012-02-02T00:31:18Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Jonathan Nieder wrote:\n> Nguyễn Thái Ngọc Duy wrote:\n\n>> --- a/t/t5150-request-pull.sh\n>> +++ b/t/t5150-request-pull.sh\n>> @@ -95,7 +95,7 @@ test_expect_success 'setup: two scripts for reading pull requests' '\n>>  \tb\n>>  \t: diffstat\n>>  \tn\n>> -\t/ [0-9]* files changed/ {\n>> +\t/ [0-9]* files\\? changed/ {\n>\n> Mimicking a human.\n>\n> (**) Should probably use \"*\" instead of \\? --- \\? is a GNU extension,\n> not a BRE.\n\n... and here's a patch making that change for convenience (also untested).\n---\n t/t5150-request-pull.sh |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/t/t5150-request-pull.sh b/t/t5150-request-pull.sh\nindex 34c482f1..ec5f7368 100755\n--- a/t/t5150-request-pull.sh\n+++ b/t/t5150-request-pull.sh\n@@ -95,7 +95,7 @@ test_expect_success 'setup: two scripts for reading pull requests' '\n \tb\n \t: diffstat\n \tn\n-\t/ [0-9]* files\\? changed/ {\n+\t/ [0-9]* files* changed/ {\n \t\ta\\\\\n \tDIFFSTAT\n \t\tb\n-- \n1.7.9\n"},{"id":"183602","messageId":"20120202142255.GA25871@do","threadId":"29489","inReplyTo":"7vhaza2qjw.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH v2] Use correct grammar in diffstat summary line","fromName":"Nguyen Thai Ngoc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2012-02-02T14:22:55Z","receivedAt":"2012-02-02T14:22:55Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Wed, Feb 01, 2012 at 01:26:43PM -0800, Junio C Hamano wrote:\n> Nice.  Will queue\n\nPlease also squash this in (resend looks ugly and it's hard to point\nout changes). It makes the code look less ugly, use Q_() for gettext\npoisoning and revert am input text back as Jonathan suggested.\n\nI take it --summary is un-i18n-able, should we introduce.. umm..\n--nice-summary or something that can support i18n?\n\n-- 8< --\ndiff --git a/diff.c b/diff.c\nindex 5f3ce97..07c94f2 100644\n--- a/diff.c\n+++ b/diff.c\n@@ -1325,6 +1325,7 @@ static void fill_print_name(struct diffstat_file *file)\n int print_stat_summary(FILE *fp, int files, int insertions, int deletions)\n {\n \tstruct strbuf sb = STRBUF_INIT;\n+\tconst char *fmt;\n \tint ret;\n \n \tif (!files) {\n@@ -1332,10 +1333,8 @@ int print_stat_summary(FILE *fp, int files, int insertions, int deletions)\n \t\treturn fputs(_(\" 0 files changed\\n\"), fp);\n \t}\n \n-\tstrbuf_addf(&sb,\n-\t\t    ngettext(\" %d file changed\", \" %d files changed\",\n-\t\t\t     files),\n-\t\t    files);\n+\tfmt = Q_(\" %d file changed\", \" %d files changed\", files);\n+\tstrbuf_addf(&sb, fmt, files);\n \n \t/*\n \t * For binary diff, the caller may want to print \"x files\n@@ -1346,25 +1345,17 @@ int print_stat_summary(FILE *fp, int files, int insertions, int deletions)\n \t * but nothing about added/removed lines? Is this a bug in Git?\").\n \t */\n \tif (insertions || deletions == 0) {\n-\t\tstrbuf_addf(&sb,\n-\t\t\t    /*\n-\t\t\t     * TRANSLATORS: \"+\" in (+) is a line addition marker;\n-\t\t\t     * do not translate it.\n-\t\t\t     */\n-\t\t\t    ngettext(\", %d insertion(+)\", \", %d insertions(+)\",\n-\t\t\t\t     insertions),\n-\t\t\t    insertions);\n+\t\t/* TRANSLATORS: \"+\" in (+) is a line addition marker,\n+\t\t   do not translate it */\n+\t\tfmt = Q_(\", %d insertion(+)\", \", %d insertions(+)\", insertions);\n+\t\tstrbuf_addf(&sb, fmt, insertions);\n \t}\n \n \tif (deletions || insertions == 0) {\n-\t\tstrbuf_addf(&sb,\n-\t\t\t    /*\n-\t\t\t     * TRANSLATORS: \"-\" in (-) is a line removal marker;\n-\t\t\t     * do not translate it.\n-\t\t\t     */\n-\t\t\t    ngettext(\", %d deletion(-)\", \", %d deletions(-)\",\n-\t\t\t\t     deletions),\n-\t\t\t    deletions);\n+\t\t/* TRANSLATORS: \"-\" in (-) is a line removal marker,\n+\t\t   do not translate it */\n+\t\tfmt = Q_(\", %d deletion(-)\", \", %d deletions(-)\", deletions);\n+\t\tstrbuf_addf(&sb, fmt, deletions);\n \t}\n \tstrbuf_addch(&sb, '\\n');\n \tret = fputs(sb.buf, fp);\ndiff --git a/t/t0023-crlf-am.sh b/t/t0023-crlf-am.sh\nindex 18fe27b..12a3d78 100755\n--- a/t/t0023-crlf-am.sh\n+++ b/t/t0023-crlf-am.sh\n@@ -12,7 +12,7 @@ Subject: test1\n \n ---\n  foo |    1 +\n- 1 file changed, 1 insertion(+)\n+ 1 files changed, 1 insertions(+)\n  create mode 100644 foo\n \n diff --git a/foo b/foo\n-- 8< --\n\n-- \nDuy\n"},{"id":"183620","messageId":"7v8vklxfe4.fsf@alter.siamese.dyndns.org","threadId":"29489","inReplyTo":"20120202142255.GA25871@do","subject":"Re: [PATCH v2] Use correct grammar in diffstat summary line","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-02-02T18:24:19Z","receivedAt":"2012-02-02T18:24:19Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes:\n\n> On Wed, Feb 01, 2012 at 01:26:43PM -0800, Junio C Hamano wrote:\n>> Nice.  Will queue\n>\n> Please also squash this in (resend looks ugly and it's hard to point\n> out changes). It makes the code look less ugly, use Q_() for gettext\n> poisoning and revert am input text back as Jonathan suggested.\n>\n> I take it --summary is un-i18n-able,...\n\n... because?\n"},{"id":"183685","messageId":"CACsJy8CcBB9OF=8a1hQEpDFzqsrkbpFKnVAcU65h_5Cnym90SQ@mail.gmail.com","threadId":"29489","inReplyTo":"7v8vklxfe4.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH v2] Use correct grammar in diffstat summary line","fromName":"Nguyen Thai Ngoc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2012-02-03T01:11:23Z","receivedAt":"2012-02-03T01:11:23Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Fri, Feb 3, 2012 at 1:24 AM, Junio C Hamano <gitster@pobox.com> wrote:\n> Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes:\n>\n>> On Wed, Feb 01, 2012 at 01:26:43PM -0800, Junio C Hamano wrote:\n>>> Nice.  Will queue\n>>\n>> Please also squash this in (resend looks ugly and it's hard to point\n>> out changes). It makes the code look less ugly, use Q_() for gettext\n>> poisoning and revert am input text back as Jonathan suggested.\n>>\n>> I take it --summary is un-i18n-able,...\n>\n> ... because?\n\n.. of scripts? We have --numstat for scripts, but I see no alternative\nto --summary. Does anybody parse --summary output?\n-- \nDuy\n"},{"id":"183687","messageId":"7vmx90u325.fsf@alter.siamese.dyndns.org","threadId":"29489","inReplyTo":"CACsJy8CcBB9OF=8a1hQEpDFzqsrkbpFKnVAcU65h_5Cnym90SQ@mail.gmail.com","subject":"Re: [PATCH v2] Use correct grammar in diffstat summary line","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-02-03T01:18:58Z","receivedAt":"2012-02-03T01:18:58Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes:\n\n> On Fri, Feb 3, 2012 at 1:24 AM, Junio C Hamano <gitster@pobox.com> wrote:\n>> Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes:\n>>\n>>> I take it --summary is un-i18n-able,...\n>>\n>> ... because?\n>\n> .. of scripts? We have --numstat for scripts, but I see no alternative\n> to --summary.\n\nAhh, you meant that --summary.  I somehow mixed that up with the \"N files\nadded, M insersion(s),...\".\n\nI've always thought that \"--summary\" lines belong to the same category as\n\"new file mode M\", \"rename from A\" and \"similarity X%\" that come at the\nbeginning of individual patches, and it probably would not make sense to\nlocalize them.\n"},{"id":"183711","messageId":"20120203122401.GE31441@sigill.intra.peff.net","threadId":"29489","inReplyTo":"CACsJy8CcBB9OF=8a1hQEpDFzqsrkbpFKnVAcU65h_5Cnym90SQ@mail.gmail.com","subject":"Re: [PATCH v2] Use correct grammar in diffstat summary line","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2012-02-03T12:24:01Z","receivedAt":"2012-02-03T12:24:01Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, Feb 03, 2012 at 08:11:23AM +0700, Nguyen Thai Ngoc Duy wrote:\n\n> >> I take it --summary is un-i18n-able,...\n> >\n> > ... because?\n> \n> .. of scripts? We have --numstat for scripts, but I see no alternative\n> to --summary. Does anybody parse --summary output?\n\nI would think it is spelled \"--raw\".\n\n-Peff\n"},{"id":"186807","messageId":"20120313045100.GA12474@burratino","threadId":"29489","inReplyTo":"1328100907-20397-1-git-send-email-pclouds@gmail.com","subject":"[RFC/PATCH 0/7] tests: diffstat summary line varies by locale (Re: [PATCH v2] Use correct grammar in diffstat summary line)","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2012-03-13T04:51:01Z","receivedAt":"2012-03-13T04:51:01Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"(-cc: Thomas)\nNguyễn Thái Ngọc Duy wrote:\n\n>  In Vietnamese, the summary line is \"thay đổi 68 tập tin, thêm(+) 163,\n>  xoá(-) 116\". Lovely. Perhaps I'll translate git into Vietnamese after\n>  all :)\n\nThough I wouldn't be able to read it, that would make me happy.\n\n>  And this patch's diffstat looks just scary due to test suite's updates.\n\nHere's a series on top that does two things:\n\n 1. make the current testsuite run again with GETTEXT_POISON enabled\n 2. try to ensure that next time someone wants to tweak --stat output,\n    fewer test updates will be needed.\n\nPatch 1 consists only of good changes that seem maint-worthy to me,\nbut it is incomplete (see patch 7).\n\nThe rest seem to work but I haven't re-checked them carefully.\n\nPatch 7 is a \"miscellany\" patch that even includes a few changes that\nshould be part of patch 1.  I am sending it this way just to get early\nfeedback on the approach; a final series would move all the\ns/test_cmp/test_i18ncmp/ changes to patch 1 and have the rest of the\nchanges split up by topic.\n\nThe series is based against 7f814632 (Use correct grammar in diffstat\nsummary line).\n\nThoughts welcome, of course.\n\nJonathan Nieder (7):\n  test: use test_i18ncmp to check --stat output\n  test: use numstat instead of diffstat in funny-names test\n  test: modernize funny-names test style\n  test: test cherry-pick functionality and output separately\n  test: use numstat instead of stat in \"git stash show\" tests\n  test: use numstat instead of diffstat in binary-diff test\n  remainder\n\n t/t3300-funny-names.sh              |  354 ++++++++++++++++++-----------------\n t/t3508-cherry-pick-many-commits.sh |   32 +++-\n t/t3903-stash.sh                    |   32 +++-\n t/t4012-diff-binary.sh              |   29 ++-\n t/t4013-diff-various.sh             |    7 +-\n t/t4014-format-patch.sh             |    9 +-\n t/t4016-diff-quote.sh               |   35 ++--\n t/t4030-diff-textconv.sh            |    6 +-\n t/t4031-diff-rewrite-binary.sh      |   10 +-\n t/t4043-diff-rename-binary.sh       |    8 +-\n t/t4045-diff-relative.sh            |   16 +-\n t/t4047-diff-dirstat.sh             |   65 +++----\n t/t4049-diff-stat-count.sh          |    2 +-\n t/t4100-apply-stat.sh               |    4 +-\n t/t5150-request-pull.sh             |    2 +-\n t/t7602-merge-octopus-many.sh       |    6 +-\n 16 files changed, 356 insertions(+), 261 deletions(-)\n"},{"id":"186808","messageId":"20120313045404.GA12550@burratino","threadId":"29489","inReplyTo":"20120313045100.GA12474@burratino","subject":"[PATCH 1/7] test: use test_i18ncmp when checking --stat output","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2012-03-13T04:54:05Z","receivedAt":"2012-03-13T04:54:05Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Ever since v1.7.9.2~13 (2012-02-01), git's diffstat-style summary line\nproduced by \"git apply --stat\", \"git diff --stat\", and \"git commit\"\nvaries by locale, producing test failures when GETTEXT_POISON is set.\n\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\nAs mentioned in the cover letter, this is incomplete.  More changes\nof the same kind, especially in t4013-diff-various.sh, are needed for\nthe testsuite to pass with GETTEXT_POISON=t.  Patch 7 has them.\n\n t/t3300-funny-names.sh              |    6 +++---\n t/t3508-cherry-pick-many-commits.sh |    4 ++--\n t/t3903-stash.sh                    |    4 ++--\n t/t4012-diff-binary.sh              |    4 ++--\n t/t4049-diff-stat-count.sh          |    2 +-\n t/t4100-apply-stat.sh               |    4 ++--\n t/t5150-request-pull.sh             |    2 +-\n t/t7602-merge-octopus-many.sh       |    6 +++---\n 8 files changed, 16 insertions(+), 16 deletions(-)\n\ndiff --git a/t/t3300-funny-names.sh b/t/t3300-funny-names.sh\nindex 9f00ada5..644aa219 100755\n--- a/t/t3300-funny-names.sh\n+++ b/t/t3300-funny-names.sh\n@@ -174,7 +174,7 @@ EOF\n test_expect_success TABS_IN_FILENAMES 'git diff-tree rename with-funny applied' \\\n \t'git diff-index -M -p $t0 |\n \t git apply --stat | sed -e \"s/|.*//\" -e \"s/ *\\$//\" >current &&\n-\t test_cmp expected current'\n+\t test_i18ncmp expected current'\n \n test_expect_success TABS_IN_FILENAMES 'setup expect' '\n cat > expected <<\\EOF\n@@ -187,12 +187,12 @@ EOF\n test_expect_success TABS_IN_FILENAMES 'git diff-tree delete with-funny applied' \\\n \t'git diff-index -p $t0 |\n \t git apply --stat | sed -e \"s/|.*//\" -e \"s/ *\\$//\" >current &&\n-\t test_cmp expected current'\n+\t test_i18ncmp expected current'\n \n test_expect_success TABS_IN_FILENAMES 'git apply non-git diff' \\\n \t'git diff-index -p $t0 |\n \t sed -ne \"/^[-+@]/p\" |\n \t git apply --stat | sed -e \"s/|.*//\" -e \"s/ *\\$//\" >current &&\n-\t test_cmp expected current'\n+\t test_i18ncmp expected current'\n \n test_done\ndiff --git a/t/t3508-cherry-pick-many-commits.sh b/t/t3508-cherry-pick-many-commits.sh\nindex 1b3a3441..d909e6db 100755\n--- a/t/t3508-cherry-pick-many-commits.sh\n+++ b/t/t3508-cherry-pick-many-commits.sh\n@@ -55,7 +55,7 @@ test_expect_success 'cherry-pick first..fourth works' '\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+\ttest_i18ncmp expected actual.fuzzy &&\n \tcheck_head_differs_from fourth\n '\n \n@@ -82,7 +82,7 @@ test_expect_success 'cherry-pick --strategy resolve first..fourth works' '\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+\ttest_i18ncmp expected actual.fuzzy &&\n \tcheck_head_differs_from fourth\n '\n \ndiff --git a/t/t3903-stash.sh b/t/t3903-stash.sh\nindex 663c60a1..c69e4da1 100755\n--- a/t/t3903-stash.sh\n+++ b/t/t3903-stash.sh\n@@ -447,7 +447,7 @@ test_expect_success 'stash show - stashes on stack, stash-like argument' '\n \t 1 file changed, 1 insertion(+)\n \tEOF\n \tgit stash show ${STASH_ID} >actual &&\n-\ttest_cmp expected actual\n+\ttest_i18ncmp expected actual\n '\n \n test_expect_success 'stash show -p - stashes on stack, stash-like argument' '\n@@ -485,7 +485,7 @@ test_expect_success 'stash show - no stashes on stack, stash-like argument' '\n \t 1 file changed, 1 insertion(+)\n \tEOF\n \tgit stash show ${STASH_ID} >actual &&\n-\ttest_cmp expected actual\n+\ttest_i18ncmp expected actual\n '\n \n test_expect_success 'stash show -p - no stashes on stack, stash-like argument' '\ndiff --git a/t/t4012-diff-binary.sh b/t/t4012-diff-binary.sh\nindex 2d9f9a0c..008cf10a 100755\n--- a/t/t4012-diff-binary.sh\n+++ b/t/t4012-diff-binary.sh\n@@ -25,11 +25,11 @@ cat > expected <<\\EOF\n EOF\n test_expect_success 'diff without --binary' \\\n \t'git diff | git apply --stat --summary >current &&\n-\t test_cmp expected current'\n+\t test_i18ncmp expected current'\n \n test_expect_success 'diff with --binary' \\\n \t'git diff --binary | git apply --stat --summary >current &&\n-\t test_cmp expected current'\n+\t test_i18ncmp expected current'\n \n # apply needs to be able to skip the binary material correctly\n # in order to report the line number of a corrupt patch.\ndiff --git a/t/t4049-diff-stat-count.sh b/t/t4049-diff-stat-count.sh\nindex a6d18875..591ffbc0 100755\n--- a/t/t4049-diff-stat-count.sh\n+++ b/t/t4049-diff-stat-count.sh\n@@ -19,7 +19,7 @@ test_expect_success setup '\n \t 2 files changed, 2 insertions(+)\n \tEOF\n \tgit diff --stat --stat-count=2 >actual &&\n-\ttest_cmp expect actual\n+\ttest_i18ncmp expect actual\n '\n \n test_done\ndiff --git a/t/t4100-apply-stat.sh b/t/t4100-apply-stat.sh\nindex 9b433de8..744b8e51 100755\n--- a/t/t4100-apply-stat.sh\n+++ b/t/t4100-apply-stat.sh\n@@ -17,13 +17,13 @@ do\n \ttest_expect_success \"$title\" '\n \t\tgit apply --stat --summary \\\n \t\t\t<\"$TEST_DIRECTORY/t4100/t-apply-$num.patch\" >current &&\n-\t\ttest_cmp \"$TEST_DIRECTORY\"/t4100/t-apply-$num.expect current\n+\t\ttest_i18ncmp \"$TEST_DIRECTORY\"/t4100/t-apply-$num.expect current\n \t'\n \n \ttest_expect_success \"$title with recount\" '\n \t\tsed -e \"$UNC\" <\"$TEST_DIRECTORY/t4100/t-apply-$num.patch\" |\n \t\tgit apply --recount --stat --summary >current &&\n-\t\ttest_cmp \"$TEST_DIRECTORY\"/t4100/t-apply-$num.expect current\n+\t\ttest_i18ncmp \"$TEST_DIRECTORY\"/t4100/t-apply-$num.expect current\n \t'\n done <<\\EOF\n rename\ndiff --git a/t/t5150-request-pull.sh b/t/t5150-request-pull.sh\nindex ec5f7368..00109533 100755\n--- a/t/t5150-request-pull.sh\n+++ b/t/t5150-request-pull.sh\n@@ -220,7 +220,7 @@ test_expect_success 'pull request format' '\n \t\tgit request-pull initial \"$downstream_url\" >../request\n \t) &&\n \t<request sed -nf fuzz.sed >request.fuzzy &&\n-\ttest_cmp expect request.fuzzy\n+\ttest_i18ncmp expect request.fuzzy\n \n '\n \ndiff --git a/t/t7602-merge-octopus-many.sh b/t/t7602-merge-octopus-many.sh\nindex 5783ebf3..bce0bd37 100755\n--- a/t/t7602-merge-octopus-many.sh\n+++ b/t/t7602-merge-octopus-many.sh\n@@ -66,7 +66,7 @@ EOF\n test_expect_success 'merge output uses pretty names' '\n \tgit reset --hard c1 &&\n \tgit merge c2 c3 c4 >actual &&\n-\ttest_cmp actual expected\n+\ttest_i18ncmp expected actual\n '\n \n cat >expected <<\\EOF\n@@ -80,7 +80,7 @@ EOF\n \n test_expect_success 'merge up-to-date output uses pretty names' '\n \tgit merge c4 c5 >actual &&\n-\ttest_cmp actual expected\n+\ttest_i18ncmp expected actual\n '\n \n cat >expected <<\\EOF\n@@ -97,7 +97,7 @@ EOF\n test_expect_success 'merge fast-forward output uses pretty names' '\n \tgit reset --hard c0 &&\n \tgit merge c1 c2 >actual &&\n-\ttest_cmp actual expected\n+\ttest_i18ncmp expected actual\n '\n \n test_done\n-- \n1.7.9.2\n"},{"id":"186809","messageId":"20120313045859.GB12550@burratino","threadId":"29489","inReplyTo":"20120313045100.GA12474@burratino","subject":"[PATCH 2/7] test: use numstat instead of diffstat in funny-names test","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2012-03-13T04:58:59Z","receivedAt":"2012-03-13T04:58:59Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"This test script checks that git's plumbing commands quote filenames\nwith special characters like space, tab, and double-quote\nappropriately in their input and output.\n\nSince commit v1.7.9.2~13 (Use correct grammar in diffstat summary\nline, 2012-02-01), the final \"1 file changed, 1 insertion(+)\" line\nfrom diffstats is translatable, meaning tests that rely on exact \"git\napply --stat\" output have to be skipped when git is not configured to\nproduce output in the C locale (for example, when GETTEXT_POISON is\nenabled).  So:\n\n - Tweak the three \"git apply --stat\" tests that check \"git apply\"'s\n   input parsing to use --numstat instead.\n\n   --numstat output is more reliable, does not vary with locale, and\n   is itself easier to parse.  These tests are mainly about how \"git\n   apply\" parses its input so this should not result in much loss of\n   coverage.\n\n - Add a new \"apply --stat\" test to check the quoting in --stat output\n   format.\n\nThis wins back a little of the test coverage lost with the patch\n\"test: use test_i18ncmp to check --stat output\" when GETTEXT_POISON is\nenabled.\n\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\nThe above description is too noisy.  The intent is:\n\n The funny-names tests that use \"apply --stat\" are doing two things:\n\n  - making sure \"git apply\" can parse a patch that uses funny\n    filenames\n  - making sure that \"git apply --stat\" can produce a diffstat\n    that uses funny filenames\n\n Only the latter requires using --stat instead of --numstat.  The\n former is intended for humans and varies by locale, while the\n latter is a format meant to stay more stable between versions\n and thus is more convenient to use in tests.\n\n This patch makes all but one of these \"apply --stat\" tests use\n --numstat instead, for the above reasons.\n\nso someone (probably I) will need to consolidate the descriptions in\na spare moment.\n\n t/t3300-funny-names.sh |   27 +++++++++++++++++----------\n 1 file changed, 17 insertions(+), 10 deletions(-)\n\ndiff --git a/t/t3300-funny-names.sh b/t/t3300-funny-names.sh\nindex 644aa219..9114893b 100755\n--- a/t/t3300-funny-names.sh\n+++ b/t/t3300-funny-names.sh\n@@ -171,28 +171,35 @@ cat >expected <<\\EOF\n EOF\n '\n \n-test_expect_success TABS_IN_FILENAMES 'git diff-tree rename with-funny applied' \\\n+test_expect_success TABS_IN_FILENAMES 'diffstat for rename with funny chars' \\\n \t'git diff-index -M -p $t0 |\n \t git apply --stat | sed -e \"s/|.*//\" -e \"s/ *\\$//\" >current &&\n \t test_i18ncmp expected current'\n \n+test_expect_success TABS_IN_FILENAMES 'numstat for rename with funny chars' \\\n+\t'cat >expected <<-\\EOF &&\n+\t0\t0\t\"tabs\\t,\\\" (dq) and spaces\"\n+\tEOF\n+\t git diff-index -M -p $t0 >diff &&\n+\t git apply --numstat <diff >current &&\n+\t test_cmp expected current'\n+\n test_expect_success TABS_IN_FILENAMES 'setup expect' '\n cat > expected <<\\EOF\n- no-funny\n- \"tabs\\t,\\\" (dq) and spaces\"\n- 2 files changed, 3 insertions(+), 3 deletions(-)\n+0\t3\tno-funny\n+3\t0\t\"tabs\\t,\\\" (dq) and spaces\"\n EOF\n '\n \n-test_expect_success TABS_IN_FILENAMES 'git diff-tree delete with-funny applied' \\\n+test_expect_success TABS_IN_FILENAMES 'numstat without -M for funny rename' \\\n \t'git diff-index -p $t0 |\n-\t git apply --stat | sed -e \"s/|.*//\" -e \"s/ *\\$//\" >current &&\n-\t test_i18ncmp expected current'\n+\t git apply --numstat >current &&\n+\t test_cmp expected current'\n \n-test_expect_success TABS_IN_FILENAMES 'git apply non-git diff' \\\n+test_expect_success TABS_IN_FILENAMES 'numstat for non-git funny rename diff' \\\n \t'git diff-index -p $t0 |\n \t sed -ne \"/^[-+@]/p\" |\n-\t git apply --stat | sed -e \"s/|.*//\" -e \"s/ *\\$//\" >current &&\n-\t test_i18ncmp expected current'\n+\t git apply --numstat >current &&\n+\t test_cmp expected current'\n \n test_done\n-- \n1.7.9.2\n"},{"id":"186810","messageId":"20120313045952.GC12550@burratino","threadId":"29489","inReplyTo":"20120313045100.GA12474@burratino","subject":"[PATCH 3/7] test: modernize funny-names test style","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2012-03-13T04:59:52Z","receivedAt":"2012-03-13T04:59:52Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"This is one of the early tests, so it uses a style that by modern\nstandards can be hard to read.  Tweak it to:\n\n - clearly declare what assertion each test is designed to check\n\n - mark tests that create state later tests will depend on with the\n   word \"setup\" so people writing or running tests know the others\n   can be skipped or reordered safely\n\n - put commands that populate a file with expected output inside\n   the corresponding test stanza, so it is easier to see by eye\n   where each test begins and ends\n\n - instead of pipelines, use commands that read and write a\n   temporary file, so bugs causing commands to segfault or produce\n   the wrong exit status can be caught.\n\nMore cosmetic changes:\n\n - put the opening quote starting each test on the same line as the\n   test_expect_* invocation, and indent the commands in each test\n   with a single tab\n\n - end the test early if the underlying filesystem cannot\n   accomodate the filenames we use, instead of marking all tests\n   with the same TABS_IN_FILENAMES prerequisite.\n\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\n t/t3300-funny-names.sh |  347 +++++++++++++++++++++++++-----------------------\n 1 file changed, 180 insertions(+), 167 deletions(-)\n\ndiff --git a/t/t3300-funny-names.sh b/t/t3300-funny-names.sh\nindex 9114893b..c53c9f65 100755\n--- a/t/t3300-funny-names.sh\n+++ b/t/t3300-funny-names.sh\n@@ -15,191 +15,204 @@ p0='no-funny'\n p1='tabs\t,\" (dq) and spaces'\n p2='just space'\n \n-cat >\"$p0\" <<\\EOF\n-1. A quick brown fox jumps over the lazy cat, oops dog.\n-2. A quick brown fox jumps over the lazy cat, oops dog.\n-3. A quick brown fox jumps over the lazy cat, oops dog.\n-EOF\n+test_expect_success 'setup' '\n+\tcat >\"$p0\" <<-\\EOF &&\n+\t1. A quick brown fox jumps over the lazy cat, oops dog.\n+\t2. A quick brown fox jumps over the lazy cat, oops dog.\n+\t3. A quick brown fox jumps over the lazy cat, oops dog.\n+\tEOF\n \n-cat 2>/dev/null >\"$p1\" \"$p0\"\n-echo 'Foo Bar Baz' >\"$p2\"\n+\t{ cat \"$p0\" >\"$p1\" || :; } &&\n+\t{ echo \"Foo Bar Baz\" >\"$p2\" || :; } &&\n \n-if test -f \"$p1\" && cmp \"$p0\" \"$p1\"\n+\tif test -f \"$p1\" && cmp \"$p0\" \"$p1\"\n+\tthen\n+\t\ttest_set_prereq TABS_IN_FILENAMES\n+\tfi\n+'\n+\n+if ! test_have_prereq TABS_IN_FILENAMES\n then\n-    test_set_prereq TABS_IN_FILENAMES\n-else\n \t# since FAT/NTFS does not allow tabs in filenames, skip this test\n-\tsay 'Your filesystem does not allow tabs in filenames'\n+\tskip_all='Your filesystem does not allow tabs in filenames'\n+\ttest_done\n fi\n \n-test_expect_success TABS_IN_FILENAMES 'setup expect' \"\n-echo 'just space\n-no-funny' >expected\n-\"\n+test_expect_success 'setup: populate index and tree' '\n+\tgit update-index --add \"$p0\" \"$p2\" &&\n+\tt0=$(git write-tree)\n+'\n \n-test_expect_success TABS_IN_FILENAMES 'git ls-files no-funny' \\\n-\t'git update-index --add \"$p0\" \"$p2\" &&\n+test_expect_success 'ls-files prints space in filename verbatim' '\n+\tprintf \"%s\\n\" \"just space\" no-funny >expected &&\n \tgit ls-files >current &&\n-\ttest_cmp expected current'\n-\n-test_expect_success TABS_IN_FILENAMES 'setup expect' '\n-t0=`git write-tree` &&\n-echo \"$t0\" >t0 &&\n+\ttest_cmp expected current\n+'\n \n-cat > expected <<\\EOF\n-just space\n-no-funny\n-\"tabs\\t,\\\" (dq) and spaces\"\n-EOF\n+test_expect_success 'setup: add funny filename' '\n+\tgit update-index --add \"$p1\" &&\n+\tt1=$(git write-tree)\n '\n \n-test_expect_success TABS_IN_FILENAMES 'git ls-files with-funny' \\\n-\t'git update-index --add \"$p1\" &&\n+test_expect_success 'ls-files quotes funny filename' '\n+\tcat >expected <<-\\EOF &&\n+\tjust space\n+\tno-funny\n+\t\"tabs\\t,\\\" (dq) and spaces\"\n+\tEOF\n \tgit ls-files >current &&\n-\ttest_cmp expected current'\n-\n-test_expect_success TABS_IN_FILENAMES 'setup expect' \"\n-echo 'just space\n-no-funny\n-tabs\t,\\\" (dq) and spaces' >expected\n-\"\n-\n-test_expect_success TABS_IN_FILENAMES 'git ls-files -z with-funny' \\\n-\t'git ls-files -z | perl -pe y/\\\\000/\\\\012/ >current &&\n-\ttest_cmp expected current'\n-\n-test_expect_success TABS_IN_FILENAMES 'setup expect' '\n-t1=`git write-tree` &&\n-echo \"$t1\" >t1 &&\n-\n-cat > expected <<\\EOF\n-just space\n-no-funny\n-\"tabs\\t,\\\" (dq) and spaces\"\n-EOF\n-'\n-\n-test_expect_success TABS_IN_FILENAMES 'git ls-tree with funny' \\\n-\t'git ls-tree -r $t1 | sed -e \"s/^[^\t]*\t//\" >current &&\n-\t test_cmp expected current'\n-\n-test_expect_success TABS_IN_FILENAMES 'setup expect' '\n-cat > expected <<\\EOF\n-A\t\"tabs\\t,\\\" (dq) and spaces\"\n-EOF\n-'\n-\n-test_expect_success TABS_IN_FILENAMES 'git diff-index with-funny' \\\n-\t'git diff-index --name-status $t0 >current &&\n-\ttest_cmp expected current'\n-\n-test_expect_success TABS_IN_FILENAMES 'git diff-tree with-funny' \\\n-\t'git diff-tree --name-status $t0 $t1 >current &&\n-\ttest_cmp expected current'\n-\n-test_expect_success TABS_IN_FILENAMES 'setup expect' \"\n-echo 'A\n-tabs\t,\\\" (dq) and spaces' >expected\n-\"\n-\n-test_expect_success TABS_IN_FILENAMES 'git diff-index -z with-funny' \\\n-\t'git diff-index -z --name-status $t0 | perl -pe y/\\\\000/\\\\012/ >current &&\n-\ttest_cmp expected current'\n-\n-test_expect_success TABS_IN_FILENAMES 'git diff-tree -z with-funny' \\\n-\t'git diff-tree -z --name-status $t0 $t1 | perl -pe y/\\\\000/\\\\012/ >current &&\n-\ttest_cmp expected current'\n-\n-test_expect_success TABS_IN_FILENAMES 'setup expect' '\n-cat > expected <<\\EOF\n-CNUM\tno-funny\t\"tabs\\t,\\\" (dq) and spaces\"\n-EOF\n-'\n-\n-test_expect_success TABS_IN_FILENAMES 'git diff-tree -C with-funny' \\\n-\t'git diff-tree -C --find-copies-harder --name-status \\\n-\t\t$t0 $t1 | sed -e 's/^C[0-9]*/CNUM/' >current &&\n-\ttest_cmp expected current'\n-\n-test_expect_success TABS_IN_FILENAMES 'setup expect' '\n-cat > expected <<\\EOF\n-RNUM\tno-funny\t\"tabs\\t,\\\" (dq) and spaces\"\n-EOF\n-'\n-\n-test_expect_success TABS_IN_FILENAMES 'git diff-tree delete with-funny' \\\n-\t'git update-index --force-remove \"$p0\" &&\n-\tgit diff-index -M --name-status \\\n-\t\t$t0 | sed -e 's/^R[0-9]*/RNUM/' >current &&\n-\ttest_cmp expected current'\n-\n-test_expect_success TABS_IN_FILENAMES 'setup expect' '\n-cat > expected <<\\EOF\n-diff --git a/no-funny \"b/tabs\\t,\\\" (dq) and spaces\"\n-similarity index NUM%\n-rename from no-funny\n-rename to \"tabs\\t,\\\" (dq) and spaces\"\n-EOF\n-'\n-\n-test_expect_success TABS_IN_FILENAMES 'git diff-tree delete with-funny' \\\n-\t'git diff-index -M -p $t0 |\n-\t sed -e \"s/index [0-9]*%/index NUM%/\" >current &&\n-\t test_cmp expected current'\n-\n-test_expect_success TABS_IN_FILENAMES 'setup expect' '\n-chmod +x \"$p1\" &&\n-cat > expected <<\\EOF\n-diff --git a/no-funny \"b/tabs\\t,\\\" (dq) and spaces\"\n-old mode 100644\n-new mode 100755\n-similarity index NUM%\n-rename from no-funny\n-rename to \"tabs\\t,\\\" (dq) and spaces\"\n-EOF\n-'\n-\n-test_expect_success TABS_IN_FILENAMES 'git diff-tree delete with-funny' \\\n-\t'git diff-index -M -p $t0 |\n-\t sed -e \"s/index [0-9]*%/index NUM%/\" >current &&\n-\t test_cmp expected current'\n+\ttest_cmp expected current\n+'\n+\n+test_expect_success 'ls-files -z does not quote funny filename' '\n+\tcat >expected <<-\\EOF &&\n+\tjust space\n+\tno-funny\n+\ttabs\t,\" (dq) and spaces\n+\tEOF\n+\tgit ls-files -z >ls-files.z &&\n+\tperl -pe \"y/\\000/\\012/\" <ls-files.z >current &&\n+\ttest_cmp expected current\n+'\n+\n+test_expect_success 'ls-tree quotes funny filename' '\n+\tcat >expected <<-\\EOF &&\n+\tjust space\n+\tno-funny\n+\t\"tabs\\t,\\\" (dq) and spaces\"\n+\tEOF\n+\tgit ls-tree -r $t1 >ls-tree &&\n+\tsed -e \"s/^[^\t]*\t//\" <ls-tree >current &&\n+\ttest_cmp expected current\n+'\n \n-test_expect_success TABS_IN_FILENAMES 'setup expect' '\n-cat >expected <<\\EOF\n- \"tabs\\t,\\\" (dq) and spaces\"\n- 1 file changed, 0 insertions(+), 0 deletions(-)\n-EOF\n-'\n-\n-test_expect_success TABS_IN_FILENAMES 'diffstat for rename with funny chars' \\\n-\t'git diff-index -M -p $t0 |\n-\t git apply --stat | sed -e \"s/|.*//\" -e \"s/ *\\$//\" >current &&\n-\t test_i18ncmp expected current'\n+test_expect_success 'diff-index --name-status quotes funny filename' '\n+\tcat >expected <<-\\EOF &&\n+\tA\t\"tabs\\t,\\\" (dq) and spaces\"\n+\tEOF\n+\tgit diff-index --name-status $t0 >current &&\n+\ttest_cmp expected current\n+'\n+\n+test_expect_success 'diff-tree --name-status quotes funny filename' '\n+\tcat >expected <<-\\EOF &&\n+\tA\t\"tabs\\t,\\\" (dq) and spaces\"\n+\tEOF\n+\tgit diff-tree --name-status $t0 $t1 >current &&\n+\ttest_cmp expected current\n+'\n+\n+test_expect_success 'diff-index -z does not quote funny filename' '\n+\tcat >expected <<-\\EOF &&\n+\tA\n+\ttabs\t,\" (dq) and spaces\n+\tEOF\n+\tgit diff-index -z --name-status $t0 >diff-index.z &&\n+\tperl -pe \"y/\\000/\\012/\" <diff-index.z >current &&\n+\ttest_cmp expected current\n+'\n+\n+test_expect_success 'diff-tree -z does not quote funny filename' '\n+\tcat >expected <<-\\EOF &&\n+\tA\n+\ttabs\t,\" (dq) and spaces\n+\tEOF\n+\tgit diff-tree -z --name-status $t0 $t1 >diff-tree.z &&\n+\tperl -pe y/\\\\000/\\\\012/ <diff-tree.z >current &&\n+\ttest_cmp expected current\n+'\n+\n+test_expect_success 'diff-tree --find-copies-harder quotes funny filename' '\n+\tcat >expected <<-\\EOF &&\n+\tCNUM\tno-funny\t\"tabs\\t,\\\" (dq) and spaces\"\n+\tEOF\n+\tgit diff-tree -C --find-copies-harder --name-status $t0 $t1 >out &&\n+\tsed -e \"s/^C[0-9]*/CNUM/\" <out >current &&\n+\ttest_cmp expected current\n+'\n+\n+test_expect_success 'setup: remove unfunny index entry' '\n+\tgit update-index --force-remove \"$p0\"\n+'\n+\n+test_expect_success 'diff-tree -M quotes funny filename' '\n+\tcat >expected <<-\\EOF &&\n+\tRNUM\tno-funny\t\"tabs\\t,\\\" (dq) and spaces\"\n+\tEOF\n+\tgit diff-index -M --name-status $t0 >out &&\n+\tsed -e \"s/^R[0-9]*/RNUM/\" <out >current &&\n+\ttest_cmp expected current\n+'\n+\n+test_expect_success 'diff-index -M -p quotes funny filename' '\n+\tcat >expected <<-\\EOF &&\n+\tdiff --git a/no-funny \"b/tabs\\t,\\\" (dq) and spaces\"\n+\tsimilarity index NUM%\n+\trename from no-funny\n+\trename to \"tabs\\t,\\\" (dq) and spaces\"\n+\tEOF\n+\tgit diff-index -M -p $t0 >diff &&\n+\tsed -e \"s/index [0-9]*%/index NUM%/\" <diff >current &&\n+\ttest_cmp expected current\n+'\n+\n+test_expect_success 'setup: mode change' '\n+\tchmod +x \"$p1\"\n+'\n+\n+test_expect_success 'diff-index -M -p with mode change quotes funny filename' '\n+\tcat >expected <<-\\EOF &&\n+\tdiff --git a/no-funny \"b/tabs\\t,\\\" (dq) and spaces\"\n+\told mode 100644\n+\tnew mode 100755\n+\tsimilarity index NUM%\n+\trename from no-funny\n+\trename to \"tabs\\t,\\\" (dq) and spaces\"\n+\tEOF\n+\tgit diff-index -M -p $t0 >diff &&\n+\tsed -e \"s/index [0-9]*%/index NUM%/\" <diff >current &&\n+\ttest_cmp expected current\n+'\n+\n+test_expect_success 'diffstat for rename quotes funny filename' '\n+\tcat >expected <<-\\EOF &&\n+\t \"tabs\\t,\\\" (dq) and spaces\"\n+\t 1 file changed, 0 insertions(+), 0 deletions(-)\n+\tEOF\n+\tgit diff-index -M -p $t0 >diff &&\n+\tgit apply --stat <diff >diffstat &&\n+\tsed -e \"s/|.*//\" -e \"s/ *\\$//\" <diffstat >current &&\n+\ttest_i18ncmp expected current\n+'\n \n-test_expect_success TABS_IN_FILENAMES 'numstat for rename with funny chars' \\\n-\t'cat >expected <<-\\EOF &&\n+test_expect_success 'numstat for rename quotes funny filename' '\n+\tcat >expected <<-\\EOF &&\n \t0\t0\t\"tabs\\t,\\\" (dq) and spaces\"\n \tEOF\n-\t git diff-index -M -p $t0 >diff &&\n-\t git apply --numstat <diff >current &&\n-\t test_cmp expected current'\n-\n-test_expect_success TABS_IN_FILENAMES 'setup expect' '\n-cat > expected <<\\EOF\n-0\t3\tno-funny\n-3\t0\t\"tabs\\t,\\\" (dq) and spaces\"\n-EOF\n+\tgit diff-index -M -p $t0 >diff &&\n+\tgit apply --numstat <diff >current &&\n+\ttest_cmp expected current\n '\n \n-test_expect_success TABS_IN_FILENAMES 'numstat without -M for funny rename' \\\n-\t'git diff-index -p $t0 |\n-\t git apply --numstat >current &&\n-\t test_cmp expected current'\n+test_expect_success 'numstat without -M quotes funny filename' '\n+\tcat >expected <<-\\EOF &&\n+\t0\t3\tno-funny\n+\t3\t0\t\"tabs\\t,\\\" (dq) and spaces\"\n+\tEOF\n+\tgit diff-index -p $t0 >diff &&\n+\tgit apply --numstat <diff >current &&\n+\ttest_cmp expected current\n+'\n \n-test_expect_success TABS_IN_FILENAMES 'numstat for non-git funny rename diff' \\\n-\t'git diff-index -p $t0 |\n-\t sed -ne \"/^[-+@]/p\" |\n-\t git apply --numstat >current &&\n-\t test_cmp expected current'\n+test_expect_success 'numstat for non-git rename diff quotes funny filename' '\n+\tcat >expected <<-\\EOF &&\n+\t0\t3\tno-funny\n+\t3\t0\t\"tabs\\t,\\\" (dq) and spaces\"\n+\tEOF\n+\tgit diff-index -p $t0 >git-diff &&\n+\tsed -ne \"/^[-+@]/p\" <git-diff >diff &&\n+\tgit apply --numstat <diff >current &&\n+\ttest_cmp expected current\n+'\n \n test_done\n-- \n1.7.9.2\n"},{"id":"186811","messageId":"20120313050036.GD12550@burratino","threadId":"29489","inReplyTo":"20120313045100.GA12474@burratino","subject":"[PATCH 4/7] test: test cherry-pick functionality and output separately","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2012-03-13T05:00:36Z","receivedAt":"2012-03-13T05:00:36Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Since v1.7.3-rc0~26^2~9 (revert: report success when using option\n--strategy, 2010-07-14), the cherry-pick-many-commits test checks the\nformat of output written to the terminal during a cherry-pick sequence\nin addition to the functionality.  There is no reason those have to\nbe checked in the same test, though, and it has some downsides:\n\n - when progress output is broken, the test result does not convey\n   whether the functionality was also broken or not\n\n - it is not immediately obvious when reading that these checks are\n   meant to prevent regressions in details of the output format and\n   are not just a roundabout way to check functional details like the\n   number of commits produced\n\n - there is a temptation to include the same kind of output checking\n   for every new cherry-pick test, which would make future changes\n   to the output unnecessarily difficult\n\nPut the tests from v1.7.3-rc0~26^2~9 in separate assertions, following\nthe principle \"test one feature at a time\".\n\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\n t/t3508-cherry-pick-many-commits.sh |   32 +++++++++++++++++++++++---------\n 1 file changed, 23 insertions(+), 9 deletions(-)\n\ndiff --git a/t/t3508-cherry-pick-many-commits.sh b/t/t3508-cherry-pick-many-commits.sh\nindex d909e6db..75f7ff4f 100755\n--- a/t/t3508-cherry-pick-many-commits.sh\n+++ b/t/t3508-cherry-pick-many-commits.sh\n@@ -35,6 +35,16 @@ test_expect_success setup '\n '\n \n test_expect_success 'cherry-pick first..fourth works' '\n+\tgit checkout -f master &&\n+\tgit reset --hard first &&\n+\ttest_tick &&\n+\tgit cherry-pick first..fourth &&\n+\tgit diff --quiet other &&\n+\tgit diff --quiet HEAD other &&\n+\tcheck_head_differs_from fourth\n+'\n+\n+test_expect_success 'output to keep user entertained during multi-pick' '\n \tcat <<-\\EOF >expected &&\n \t[master OBJID] second\n \t Author: A U Thor <author@example.com>\n@@ -51,15 +61,22 @@ test_expect_success 'cherry-pick first..fourth works' '\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_i18ncmp expected actual.fuzzy &&\n-\tcheck_head_differs_from fourth\n+\ttest_line_count -ge 3 actual.fuzzy &&\n+\ttest_i18ncmp expected actual.fuzzy\n '\n \n test_expect_success 'cherry-pick --strategy resolve first..fourth works' '\n+\tgit checkout -f master &&\n+\tgit reset --hard first &&\n+\ttest_tick &&\n+\tgit cherry-pick --strategy resolve first..fourth &&\n+\tgit diff --quiet other &&\n+\tgit diff --quiet HEAD other &&\n+\tcheck_head_differs_from fourth\n+'\n+\n+test_expect_success 'output during multi-pick indicates merge strategy' '\n \tcat <<-\\EOF >expected &&\n \tTrying simple merge.\n \t[master OBJID] second\n@@ -79,11 +96,8 @@ test_expect_success 'cherry-pick --strategy resolve first..fourth works' '\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_i18ncmp expected actual.fuzzy &&\n-\tcheck_head_differs_from fourth\n+\ttest_i18ncmp expected actual.fuzzy\n '\n \n test_expect_success 'cherry-pick --ff first..fourth works' '\n-- \n1.7.9.2\n"},{"id":"186812","messageId":"20120313050132.GE12550@burratino","threadId":"29489","inReplyTo":"20120313045100.GA12474@burratino","subject":"[PATCH 5/7] test: use --numstat instead of --stat in \"git stash show\" tests","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2012-03-13T05:01:32Z","receivedAt":"2012-03-13T05:01:32Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"git's diff --stat output is intended for human consumption and\nsince v1.7.9.2~13 (2012-02-01) varies by locale.  Add a test checking\nthat git stash show defaults to --stat and tweak the rest of the\n\"stash show\" tests that showed a diffstat to use numstat.\n\nThis way, there are fewer tests to tweak if the diffstat format\nchanges again.  This also improves test coverage when running tests\nwith git configured not to write its output in the C locale (e.g.,\nvia GETTEXT_POISON=Yes).\n\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\n t/t3903-stash.sh |   36 ++++++++++++++++++++++++------------\n 1 file changed, 24 insertions(+), 12 deletions(-)\n\ndiff --git a/t/t3903-stash.sh b/t/t3903-stash.sh\nindex c69e4da1..3addb804 100755\n--- a/t/t3903-stash.sh\n+++ b/t/t3903-stash.sh\n@@ -432,6 +432,24 @@ test_expect_success 'stash branch - stashes on stack, stash-like argument' '\n \ttest $(git ls-files --modified | wc -l) -eq 1\n '\n \n+test_expect_success 'stash show format defaults to --stat' '\n+\tgit stash clear &&\n+\ttest_when_finished \"git reset --hard HEAD\" &&\n+\tgit reset --hard &&\n+\techo foo >> file &&\n+\tgit stash &&\n+\ttest_when_finished \"git stash drop\" &&\n+\techo bar >> file &&\n+\tSTASH_ID=$(git stash create) &&\n+\tgit reset --hard &&\n+\tcat >expected <<-EOF &&\n+\t file |    1 +\n+\t 1 file changed, 1 insertion(+)\n+\tEOF\n+\tgit stash show ${STASH_ID} >actual &&\n+\ttest_i18ncmp expected actual\n+'\n+\n test_expect_success 'stash show - stashes on stack, stash-like argument' '\n \tgit stash clear &&\n \ttest_when_finished \"git reset --hard HEAD\" &&\n@@ -442,12 +460,9 @@ test_expect_success 'stash show - stashes on stack, stash-like argument' '\n \techo bar >> file &&\n \tSTASH_ID=$(git stash create) &&\n \tgit reset --hard &&\n-\tcat >expected <<-EOF &&\n-\t file |    1 +\n-\t 1 file changed, 1 insertion(+)\n-\tEOF\n-\tgit stash show ${STASH_ID} >actual &&\n-\ttest_i18ncmp expected actual\n+\techo \"1\t0\tfile\" >expected &&\n+\tgit stash show --numstat ${STASH_ID} >actual &&\n+\ttest_cmp expected actual\n '\n \n test_expect_success 'stash show -p - stashes on stack, stash-like argument' '\n@@ -480,12 +495,9 @@ test_expect_success 'stash show - no stashes on stack, stash-like argument' '\n \techo foo >> file &&\n \tSTASH_ID=$(git stash create) &&\n \tgit reset --hard &&\n-\tcat >expected <<-EOF &&\n-\t file |    1 +\n-\t 1 file changed, 1 insertion(+)\n-\tEOF\n-\tgit stash show ${STASH_ID} >actual &&\n-\ttest_i18ncmp expected actual\n+\techo \"1\t0\tfile\" >expected &&\n+\tgit stash show --numstat ${STASH_ID} >actual &&\n+\ttest_cmp expected actual\n '\n \n test_expect_success 'stash show -p - no stashes on stack, stash-like argument' '\n-- \n1.7.9.2\n"},{"id":"186813","messageId":"20120313050219.GF12550@burratino","threadId":"29489","inReplyTo":"20120313045100.GA12474@burratino","subject":"[PATCH 6/7] test: use numstat instead of diffstat in binary-diff test","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2012-03-13T05:02:19Z","receivedAt":"2012-03-13T05:02:19Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"git's --stat output is intended for humans and since v1.7.9.2~13\n(2012-02-01) varies by locale.  The tests in this script using \"apply\n--stat\" are meant to check two things:\n\n - how binary file changes are accounted for and printed in\n   git's diffstat format\n\n - that \"git apply\" can parse the various forms of binary diff\n\nSplit these two kinds of check into separate tests, and use --numstat\ninstead of --stat in the latter.  This way, we lose less test coverage\nwhen git is being run without writing its output in the C locale (for\nexample because GETTEXT_POISON is enabled) and there are fewer tests\nto change if the --stat output needs to be tweaked again.\n\nWhile at it, use commands separated by && that read and write to\ntemporary files in place of pipelines so segfaults and other failures\nin the upstream of the processing pipeline don't get hidden.\n\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\n t/t4012-diff-binary.sh |   29 +++++++++++++++++++++++------\n 1 file changed, 23 insertions(+), 6 deletions(-)\n\ndiff --git a/t/t4012-diff-binary.sh b/t/t4012-diff-binary.sh\nindex 008cf10a..ed24ddd8 100755\n--- a/t/t4012-diff-binary.sh\n+++ b/t/t4012-diff-binary.sh\n@@ -8,6 +8,13 @@ test_description='Binary diff and apply\n \n . ./test-lib.sh\n \n+cat >expect.binary-numstat <<\\EOF\n+1\t1\ta\n+-\t-\tb\n+1\t1\tc\n+-\t-\td\n+EOF\n+\n test_expect_success 'prepare repository' \\\n \t'echo AIT >a && echo BIT >b && echo CIT >c && echo DIT >d &&\n \t git update-index --add a b c d &&\n@@ -23,13 +30,23 @@ cat > expected <<\\EOF\n  d |  Bin\n  4 files changed, 2 insertions(+), 2 deletions(-)\n EOF\n-test_expect_success 'diff without --binary' \\\n-\t'git diff | git apply --stat --summary >current &&\n-\t test_i18ncmp expected current'\n+test_expect_success '\"apply --stat\" output for binary file change' '\n+\tgit diff >diff &&\n+\tgit apply --stat --summary <diff >current &&\n+\ttest_i18ncmp expected current\n+'\n \n-test_expect_success 'diff with --binary' \\\n-\t'git diff --binary | git apply --stat --summary >current &&\n-\t test_i18ncmp expected current'\n+test_expect_success 'apply --numstat notices binary file change' '\n+\tgit diff >diff &&\n+\tgit apply --numstat <diff >current &&\n+\ttest_cmp expect.binary-numstat current\n+'\n+\n+test_expect_success 'apply --numstat understands diff --binary format' '\n+\tgit diff --binary >diff &&\n+\tgit apply --numstat <diff >current &&\n+\ttest_cmp expect.binary-numstat current\n+'\n \n # apply needs to be able to skip the binary material correctly\n # in order to report the line number of a corrupt patch.\n-- \n1.7.9.2\n"},{"id":"186814","messageId":"20120313050554.GG12550@burratino","threadId":"29489","inReplyTo":"20120313045100.GA12474@burratino","subject":"[PATCH 7/7] diffstat summary line varies by locale: miscellany","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2012-03-13T05:05:54Z","receivedAt":"2012-03-13T05:05:54Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"These changes are in the same spirit as the six patches that\nprecede them, but they haven't been split into individually\njustifiable patches yet.\n\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\nThe t4013-diff-various.sh change is what I would be most interested in\nfeedback on.\n\nThanks for reading, and sorry for the rough state of these patches.\nI am sending them out now mostly so others do not have to start from\nscratch repeating the same work in order to keep using the\nGETTEXT_POISON facility.\n\nGood night,\nJonathan\n\n t/t4013-diff-various.sh        |    7 ++++-\n t/t4014-format-patch.sh        |    9 ++----\n t/t4016-diff-quote.sh          |   35 ++++++++++++++--------\n t/t4030-diff-textconv.sh       |    6 +++-\n t/t4031-diff-rewrite-binary.sh |   10 +++++--\n t/t4043-diff-rename-binary.sh  |    8 ++---\n t/t4045-diff-relative.sh       |   16 ++++++++--\n t/t4047-diff-dirstat.sh        |   65 +++++++++++++++++++---------------------\n 8 files changed, 94 insertions(+), 62 deletions(-)\n\ndiff --git a/t/t4013-diff-various.sh b/t/t4013-diff-various.sh\nindex 93a6f208..e77c09c3 100755\n--- a/t/t4013-diff-various.sh\n+++ b/t/t4013-diff-various.sh\n@@ -128,7 +128,12 @@ do\n \t\t} >\"$actual\" &&\n \t\tif test -f \"$expect\"\n \t\tthen\n-\t\t\ttest_cmp \"$expect\" \"$actual\" &&\n+\t\t\tcase $cmd in\n+\t\t\t*format-patch* | *-stat*)\n+\t\t\t\ttest_i18ncmp \"$expect\" \"$actual\";;\n+\t\t\t*)\n+\t\t\t\ttest_cmp \"$expect\" \"$actual\";;\n+\t\t\tesac &&\n \t\t\trm -f \"$actual\"\n \t\telse\n \t\t\t# this is to help developing new tests.\ndiff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh\nindex 7dfe716c..b473b6d6 100755\n--- a/t/t4014-format-patch.sh\n+++ b/t/t4014-format-patch.sh\n@@ -518,11 +518,6 @@ test_expect_success 'shortlog of cover-letter wraps overly-long onelines' '\n '\n \n cat > expect << EOF\n----\n- file |   16 ++++++++++++++++\n- 1 file changed, 16 insertions(+)\n-\n-diff --git a/file b/file\n index 40f36c6..2dc5c23 100644\n --- a/file\n +++ b/file\n@@ -537,7 +532,9 @@ EOF\n test_expect_success 'format-patch respects -U' '\n \n \tgit format-patch -U4 -2 &&\n-\tsed -e \"1,/^\\$/d\" -e \"/^+5/q\" < 0001-This-is-an-excessively-long-subject-line-for-a-messa.patch > output &&\n+\tsed -e \"1,/^diff/d\" -e \"/^+5/q\" \\\n+\t\t<0001-This-is-an-excessively-long-subject-line-for-a-messa.patch \\\n+\t\t>output &&\n \ttest_cmp expect output\n \n '\ndiff --git a/t/t4016-diff-quote.sh b/t/t4016-diff-quote.sh\nindex ab0c2f05..3ec71184 100755\n--- a/t/t4016-diff-quote.sh\n+++ b/t/t4016-diff-quote.sh\n@@ -57,22 +57,33 @@ test_expect_success TABS_IN_FILENAMES 'git diff --summary -M HEAD' '\n \ttest_cmp expect actual\n '\n \n-test_expect_success TABS_IN_FILENAMES 'setup expected files' '\n-cat >expect <<\\EOF\n- pathname.1 => \"Rpathname\\twith HT.0\"            |    0\n- pathname.3 => \"Rpathname\\nwith LF.0\"            |    0\n- \"pathname\\twith HT.3\" => \"Rpathname\\nwith LF.1\" |    0\n- pathname.2 => Rpathname with SP.0               |    0\n- \"pathname\\twith HT.2\" => Rpathname with SP.1    |    0\n- pathname.0 => Rpathname.0                       |    0\n- \"pathname\\twith HT.0\" => Rpathname.1            |    0\n- 7 files changed, 0 insertions(+), 0 deletions(-)\n-EOF\n+test_expect_success TABS_IN_FILENAMES 'git diff --numstat -M HEAD' '\n+\tcat >expect <<-\\EOF &&\n+\t0\t0\tpathname.1 => \"Rpathname\\twith HT.0\"\n+\t0\t0\tpathname.3 => \"Rpathname\\nwith LF.0\"\n+\t0\t0\t\"pathname\\twith HT.3\" => \"Rpathname\\nwith LF.1\"\n+\t0\t0\tpathname.2 => Rpathname with SP.0\n+\t0\t0\t\"pathname\\twith HT.2\" => Rpathname with SP.1\n+\t0\t0\tpathname.0 => Rpathname.0\n+\t0\t0\t\"pathname\\twith HT.0\" => Rpathname.1\n+\tEOF\n+\tgit diff --numstat -M HEAD >actual &&\n+\ttest_cmp expect actual\n '\n \n test_expect_success TABS_IN_FILENAMES 'git diff --stat -M HEAD' '\n+\tcat >expect <<-\\EOF &&\n+\t pathname.1 => \"Rpathname\\twith HT.0\"            |    0\n+\t pathname.3 => \"Rpathname\\nwith LF.0\"            |    0\n+\t \"pathname\\twith HT.3\" => \"Rpathname\\nwith LF.1\" |    0\n+\t pathname.2 => Rpathname with SP.0               |    0\n+\t \"pathname\\twith HT.2\" => Rpathname with SP.1    |    0\n+\t pathname.0 => Rpathname.0                       |    0\n+\t \"pathname\\twith HT.0\" => Rpathname.1            |    0\n+\t 7 files changed, 0 insertions(+), 0 deletions(-)\n+\tEOF\n \tgit diff --stat -M HEAD >actual &&\n-\ttest_cmp expect actual\n+\ttest_i18ncmp expect actual\n '\n \n test_done\ndiff --git a/t/t4030-diff-textconv.sh b/t/t4030-diff-textconv.sh\nindex 4ac162cf..06b05df8 100755\n--- a/t/t4030-diff-textconv.sh\n+++ b/t/t4030-diff-textconv.sh\n@@ -91,7 +91,11 @@ EOF\n test_expect_success 'diffstat does not run textconv' '\n \techo file diff=fail >.gitattributes &&\n \tgit diff --stat HEAD^ HEAD >actual &&\n-\ttest_cmp expect.stat actual\n+\ttest_i18ncmp expect.stat actual &&\n+\n+\thead -n1 <expect.stat >expect.line1 &&\n+\thead -n1 <actual >actual.line1 &&\n+\ttest_cmp expect.line1 actual.line1\n '\n # restore working setup\n echo file diff=foo >.gitattributes\ndiff --git a/t/t4031-diff-rewrite-binary.sh b/t/t4031-diff-rewrite-binary.sh\nindex 7d7470f2..c8296fa4 100755\n--- a/t/t4031-diff-rewrite-binary.sh\n+++ b/t/t4031-diff-rewrite-binary.sh\n@@ -44,10 +44,16 @@ test_expect_success 'rewrite diff can show binary patch' '\n \tgrep \"GIT binary patch\" diff\n '\n \n-test_expect_success 'rewrite diff --stat shows binary changes' '\n+test_expect_success 'rewrite diff --numstat shows binary changes' '\n+\tgit diff -B --numstat --summary >diff &&\n+\tgrep -e \"-\t-\t\" diff &&\n+\tgrep \" rewrite file\" diff\n+'\n+\n+test_expect_success 'diff --stat counts binary rewrite as 0 lines' '\n \tgit diff -B --stat --summary >diff &&\n \tgrep \"Bin\" diff &&\n-\tgrep \"0 insertions.*0 deletions\" diff &&\n+\ttest_i18ngrep \"0 insertions.*0 deletions\" diff &&\n \tgrep \" rewrite file\" diff\n '\n \ndiff --git a/t/t4043-diff-rename-binary.sh b/t/t4043-diff-rename-binary.sh\nindex 06012811..2a2cf913 100755\n--- a/t/t4043-diff-rename-binary.sh\n+++ b/t/t4043-diff-rename-binary.sh\n@@ -23,9 +23,8 @@ test_expect_success 'move the files into a \"sub\" directory' '\n '\n \n cat > expected <<\\EOF\n- bar => sub/bar |  Bin 5 -> 5 bytes\n- foo => sub/foo |    0\n- 2 files changed, 0 insertions(+), 0 deletions(-)\n+-\t-\tbar => sub/bar\n+0\t0\tfoo => sub/foo\n \n diff --git a/bar b/sub/bar\n similarity index 100%\n@@ -38,7 +37,8 @@ rename to sub/foo\n EOF\n \n test_expect_success 'git show -C -C report renames' '\n-\tgit show -C -C --raw --binary --stat | tail -n 12 > current &&\n+\tgit show -C -C --raw --binary --numstat >patch-with-stat &&\n+\ttail -n 11 patch-with-stat >current &&\n \ttest_cmp expected current\n '\n \ndiff --git a/t/t4045-diff-relative.sh b/t/t4045-diff-relative.sh\nindex bd119be1..18fadcf0 100755\n--- a/t/t4045-diff-relative.sh\n+++ b/t/t4045-diff-relative.sh\n@@ -29,6 +29,18 @@ test_expect_success \"-p $*\" \"\n \"\n }\n \n+check_numstat() {\n+expect=$1; shift\n+cat >expected <<EOF\n+1\t0\t$expect\n+EOF\n+test_expect_success \"--numstat $*\" \"\n+\techo '1\t0\t$expect' >expected &&\n+\tgit diff --numstat $* HEAD^ >actual &&\n+\ttest_cmp expected actual\n+\"\n+}\n+\n check_stat() {\n expect=$1; shift\n cat >expected <<EOF\n@@ -37,7 +49,7 @@ cat >expected <<EOF\n EOF\n test_expect_success \"--stat $*\" \"\n \tgit diff --stat $* HEAD^ >actual &&\n-\ttest_cmp expected actual\n+\ttest_i18ncmp expected actual\n \"\n }\n \n@@ -52,7 +64,7 @@ test_expect_success \"--raw $*\" \"\n \"\n }\n \n-for type in diff stat raw; do\n+for type in diff numstat stat raw; do\n \tcheck_$type file2 --relative=subdir/\n \tcheck_$type file2 --relative=subdir\n \tcheck_$type dir/file2 --relative=sub\ndiff --git a/t/t4047-diff-dirstat.sh b/t/t4047-diff-dirstat.sh\nindex 29e80a58..ed7e0933 100755\n--- a/t/t4047-diff-dirstat.sh\n+++ b/t/t4047-diff-dirstat.sh\n@@ -252,50 +252,47 @@ EOF\n '\n \n cat <<EOF >expect_diff_stat\n- changed/text             |    2 +-\n- dst/copy/changed/text    |   10 ++++++++++\n- dst/copy/rearranged/text |   10 ++++++++++\n- dst/copy/unchanged/text  |   10 ++++++++++\n- dst/move/changed/text    |   10 ++++++++++\n- dst/move/rearranged/text |   10 ++++++++++\n- dst/move/unchanged/text  |   10 ++++++++++\n- rearranged/text          |    2 +-\n- src/move/changed/text    |   10 ----------\n- src/move/rearranged/text |   10 ----------\n- src/move/unchanged/text  |   10 ----------\n- 11 files changed, 62 insertions(+), 32 deletions(-)\n+1\t1\tchanged/text\n+10\t0\tdst/copy/changed/text\n+10\t0\tdst/copy/rearranged/text\n+10\t0\tdst/copy/unchanged/text\n+10\t0\tdst/move/changed/text\n+10\t0\tdst/move/rearranged/text\n+10\t0\tdst/move/unchanged/text\n+1\t1\trearranged/text\n+0\t10\tsrc/move/changed/text\n+0\t10\tsrc/move/rearranged/text\n+0\t10\tsrc/move/unchanged/text\n EOF\n \n cat <<EOF >expect_diff_stat_M\n- changed/text                      |    2 +-\n- dst/copy/changed/text             |   10 ++++++++++\n- dst/copy/rearranged/text          |   10 ++++++++++\n- dst/copy/unchanged/text           |   10 ++++++++++\n- {src => dst}/move/changed/text    |    2 +-\n- {src => dst}/move/rearranged/text |    2 +-\n- {src => dst}/move/unchanged/text  |    0\n- rearranged/text                   |    2 +-\n- 8 files changed, 34 insertions(+), 4 deletions(-)\n+1\t1\tchanged/text\n+10\t0\tdst/copy/changed/text\n+10\t0\tdst/copy/rearranged/text\n+10\t0\tdst/copy/unchanged/text\n+1\t1\t{src => dst}/move/changed/text\n+1\t1\t{src => dst}/move/rearranged/text\n+0\t0\t{src => dst}/move/unchanged/text\n+1\t1\trearranged/text\n EOF\n \n cat <<EOF >expect_diff_stat_CC\n- changed/text                      |    2 +-\n- {src => dst}/copy/changed/text    |    2 +-\n- {src => dst}/copy/rearranged/text |    2 +-\n- {src => dst}/copy/unchanged/text  |    0\n- {src => dst}/move/changed/text    |    2 +-\n- {src => dst}/move/rearranged/text |    2 +-\n- {src => dst}/move/unchanged/text  |    0\n- rearranged/text                   |    2 +-\n- 8 files changed, 6 insertions(+), 6 deletions(-)\n+1\t1\tchanged/text\n+1\t1\t{src => dst}/copy/changed/text\n+1\t1\t{src => dst}/copy/rearranged/text\n+0\t0\t{src => dst}/copy/unchanged/text\n+1\t1\t{src => dst}/move/changed/text\n+1\t1\t{src => dst}/move/rearranged/text\n+0\t0\t{src => dst}/move/unchanged/text\n+1\t1\trearranged/text\n EOF\n \n-test_expect_success 'sanity check setup (--stat)' '\n-\tgit diff --stat HEAD^..HEAD >actual_diff_stat &&\n+test_expect_success 'sanity check setup (--numstat)' '\n+\tgit diff --numstat HEAD^..HEAD >actual_diff_stat &&\n \ttest_cmp expect_diff_stat actual_diff_stat &&\n-\tgit diff --stat -M HEAD^..HEAD >actual_diff_stat_M &&\n+\tgit diff --numstat -M HEAD^..HEAD >actual_diff_stat_M &&\n \ttest_cmp expect_diff_stat_M actual_diff_stat_M &&\n-\tgit diff --stat -C -C HEAD^..HEAD >actual_diff_stat_CC &&\n+\tgit diff --numstat -C -C HEAD^..HEAD >actual_diff_stat_CC &&\n \ttest_cmp expect_diff_stat_CC actual_diff_stat_CC\n '\n \n-- \n1.7.9.2\n"},{"id":"186817","messageId":"7vzkblkpkk.fsf@alter.siamese.dyndns.org","threadId":"29489","inReplyTo":"20120313045404.GA12550@burratino","subject":"Re: [PATCH 1/7] test: use test_i18ncmp when checking --stat output","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-03-13T06:00:43Z","receivedAt":"2012-03-13T06:00:43Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jonathan Nieder <jrnieder@gmail.com> writes:\n\n> diff --git a/t/t3508-cherry-pick-many-commits.sh b/t/t3508-cherry-pick-many-commits.sh\n> index 1b3a3441..d909e6db 100755\n> --- a/t/t3508-cherry-pick-many-commits.sh\n> +++ b/t/t3508-cherry-pick-many-commits.sh\n> @@ -55,7 +55,7 @@ test_expect_success 'cherry-pick first..fourth works' '\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> +\ttest_i18ncmp expected actual.fuzzy &&\n>  \tcheck_head_differs_from fourth\n>  '\n>  \n> @@ -82,7 +82,7 @@ test_expect_success 'cherry-pick --strategy resolve first..fourth works' '\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> +\ttest_i18ncmp expected actual.fuzzy &&\n>  \tcheck_head_differs_from fourth\n>  '\n\nHonestly speaking, I am not sure if we should be making these\ncomparisons to cast the informational output from cherry-pick\nthat is meant for human concumption in stone to begin with.\n\nI think \"cherry-pick first..fourth works\" test should be comparing\nthe output from something like \"log --format=%s\" over the range\nbefore and after the replaying.\n\nAll the other changes in this patch I do agree with; in C locale\nthese are expected to exactly match what we specify in these tests\nand I do not see any reason to update them, but it is OK that they\nare translated and attempting to limit the matches to untranslatable\npart is not worth it.  test_i18ncmp is the tool for such comparison.\n\nBut I do not think the progress output from range cherry-pick needs\nto be cast in stone even in C locale, hence the comments in the\nfirst two paragraphs from me.\n"},{"id":"186818","messageId":"7vvcm9kpcs.fsf@alter.siamese.dyndns.org","threadId":"29489","inReplyTo":"7vzkblkpkk.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 1/7] test: use test_i18ncmp when checking --stat output","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-03-13T06:05:23Z","receivedAt":"2012-03-13T06:05:23Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> But I do not think the progress output from range cherry-pick needs\n> to be cast in stone even in C locale, hence the comments in the\n> first two paragraphs from me.\n\nAhh, I spoke too early before reading them through.  You do touch\nthem later in the series.\n\nSorry for the noise, and thanks.\n"},{"id":"186819","messageId":"20120313060617.GA16784@burratino","threadId":"29489","inReplyTo":"7vzkblkpkk.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 1/7] test: use test_i18ncmp when checking --stat output","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2012-03-13T06:06:17Z","receivedAt":"2012-03-13T06:06:17Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Junio C Hamano wrote:\n> Jonathan Nieder <jrnieder@gmail.com> writes:\n\n>> --- a/t/t3508-cherry-pick-many-commits.sh\n>> +++ b/t/t3508-cherry-pick-many-commits.sh\n>> @@ -55,7 +55,7 @@ test_expect_success 'cherry-pick first..fourth works' '\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>> +\ttest_i18ncmp expected actual.fuzzy &&\n>>  \tcheck_head_differs_from fourth\n>>  '\n[...]\n> Honestly speaking, I am not sure if we should be making these\n> comparisons to cast the informational output from cherry-pick\n> that is meant for human concumption in stone to begin with.\n\nYou might like patch 4, then. ;-)\n"},{"id":"186820","messageId":"20120313061343.GB16784@burratino","threadId":"29489","inReplyTo":"7vvcm9kpcs.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 1/7] test: use test_i18ncmp when checking --stat output","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2012-03-13T06:13:43Z","receivedAt":"2012-03-13T06:13:43Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Junio C Hamano wrote:\n> Junio C Hamano <gitster@pobox.com> writes:\n\n>> But I do not think the progress output from range cherry-pick needs\n>> to be cast in stone even in C locale, hence the comments in the\n>> first two paragraphs from me.\n>\n> Ahh, I spoke too early before reading them through.  You do touch\n> them later in the series.\n>\n> Sorry for the noise, and thanks.\n\nNo problem.  Sorry for the crossed messages.\n"}]}