{"thread":{"id":"34063","subject":"[PATCH 1/2] rm: better error message on failure for multiple files","startedAt":"2013-06-08T08:33:53Z","lastAt":"2013-06-10T11:28:54Z","messageCount":10,"participants":["Mathieu Lienard--Mayor","Ramkumar Ramachandra","Mathieu Liénard--Mayor","Matthieu Moy","Célestin Matte"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"219787","messageId":"1370680434-2709-1-git-send-email-Mathieu.Lienard--Mayor@ensimag.imag.fr","threadId":"34063","inReplyTo":null,"subject":"[PATCH 1/2] rm: better error message on failure for multiple files","fromName":"Mathieu Lienard--Mayor","fromEmail":"mathieu.lienard--mayor@ensimag.imag.fr","sentAt":"2013-06-08T08:33:53Z","receivedAt":"2013-06-08T08:33:53Z","isPatch":true,"sender":{"key":"mathieu.lienard--mayor@ensimag.imag.fr","avatar":null},"body":"From: Mathieu Liénard--Mayor <Mathieu.Lienard--Mayor@ensimag.imag.fr>\n\nWhen 'git rm' fails, it now displays a single message\nwith the list of files involved, instead of displaying\na list of messages with one file each.\n\nAs an example, the old message:\n\terror: 'foo.txt' has changes staged in the index\n\t(use --cached to keep the file, or -f to force removal)\n\terror: 'bar.txt' has changes staged in the index\n\t(use --cached to keep the file, or -f to force removal)\n\nwould now be displayed as:\n\terror: the following files have changes staged in the index:\n\t\tfoo.txt\n\t\tbar.txt\n\t(use --cached to keep the file, or -f to force removal)\n\nSigned-off-by: Mathieu Lienard--Mayor <Mathieu.Lienard--Mayor@ensimag.imag.fr>\nSigned-off-by: Jorge Juan Garcia Garcia <Jorge-Juan.garcia-Garcia@ensimag.imag.fr>\nSigned-off-by: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>\n---\n builtin/rm.c  |   54 ++++++++++++++++++++++++++++++++++++++----------------\n t/t3600-rm.sh |   45 +++++++++++++++++++++++++++++++++++++++++++++\n 2 files changed, 83 insertions(+), 16 deletions(-)\n\ndiff --git a/builtin/rm.c b/builtin/rm.c\nindex 7b91d52..5b2abd2 100644\n--- a/builtin/rm.c\n+++ b/builtin/rm.c\n@@ -82,6 +82,11 @@ static int check_local_mod(unsigned char *head, int index_only)\n \tint i, no_head;\n \tint errs = 0;\n \n+\tstruct strbuf files_staged = STRBUF_INIT;\n+\tstruct strbuf files_cached = STRBUF_INIT;\n+\tstruct strbuf files_submodule = STRBUF_INIT;\n+\tstruct strbuf files_local = STRBUF_INIT;\n+\n \tno_head = is_null_sha1(head);\n \tfor (i = 0; i < list.nr; i++) {\n \t\tstruct stat st;\n@@ -170,30 +175,47 @@ static int check_local_mod(unsigned char *head, int index_only)\n \t\t * \"intent to add\" entry.\n \t\t */\n \t\tif (local_changes && staged_changes) {\n-\t\t\tif (!index_only || !(ce->ce_flags & CE_INTENT_TO_ADD))\n-\t\t\t\terrs = error(_(\"'%s' has staged content different \"\n-\t\t\t\t\t     \"from both the file and the HEAD\\n\"\n-\t\t\t\t\t     \"(use -f to force removal)\"), name);\n+\t\t\tif (!index_only || !(ce->ce_flags & CE_INTENT_TO_ADD)) {\n+\t\t\t\tstrbuf_addstr(&files_staged, \"\\n\t\");\n+\t\t\t\tstrbuf_addstr(&files_staged, name);\n+\t\t\t}\n \t\t}\n \t\telse if (!index_only) {\n-\t\t\tif (staged_changes)\n-\t\t\t\terrs = error(_(\"'%s' has changes staged in the index\\n\"\n-\t\t\t\t\t     \"(use --cached to keep the file, \"\n-\t\t\t\t\t     \"or -f to force removal)\"), name);\n+\t\t\tif (staged_changes) {\n+\t\t\t\tstrbuf_addstr(&files_cached, \"\\n\t\");\n+\t\t\t\tstrbuf_addstr(&files_cached, name);\n+\t\t\t}\n \t\t\tif (local_changes) {\n \t\t\t\tif (S_ISGITLINK(ce->ce_mode) &&\n \t\t\t\t    !submodule_uses_gitfile(name)) {\n-\t\t\t\t\terrs = error(_(\"submodule '%s' (or one of its nested \"\n-\t\t\t\t\t\t     \"submodules) uses a .git directory\\n\"\n-\t\t\t\t\t\t     \"(use 'rm -rf' if you really want to remove \"\n-\t\t\t\t\t\t     \"it including all of its history)\"), name);\n-\t\t\t\t} else\n-\t\t\t\t\terrs = error(_(\"'%s' has local modifications\\n\"\n-\t\t\t\t\t\t     \"(use --cached to keep the file, \"\n-\t\t\t\t\t\t     \"or -f to force removal)\"), name);\n+\t\t\t\t\tstrbuf_addstr(&files_submodule, \"\\n\t\");\n+\t\t\t\t\tstrbuf_addstr(&files_submodule, name);\n+\t\t\t\t} else {\n+\t\t\t\t\tstrbuf_addstr(&files_local, \"\\n\t\");\n+\t\t\t\t\tstrbuf_addstr(&files_local, name);\n+\t\t\t\t}\n \t\t\t}\n \t\t}\n \t}\n+\n+\tif (files_staged.len)\n+\t\terrs = error(_(\"the following files have staged content \"\n+\t\t\t       \"different from both the\\nfileand the HEAD:%s\\n\"\n+\t\t\t       \"(use -f to force removal)\"), files_staged.buf);\n+\tif (files_cached.len)\n+\t\terrs = error(_(\"the following files have changes staged \"\n+\t\t\t       \"in the index:%s\\n(use --cached to keep the file, \"\n+\t\t\t       \"or -f to force removal)\"), files_cached.buf);\n+\tif (files_submodule.len)\n+\t\terrs = error(_(\"the following submodules (or one of its nested \"\n+\t\t\t       \"submodule) use a .git directory:%s\\n\"\n+\t\t\t       \"(use 'rm -rf' if you really want to remove \"\n+\t\t\t       \"it including all of its history)\"), files_submodule.buf);\n+\tif (files_local.len)\n+\t\terrs = error(_(\"the following files have local modifications:\"\n+\t\t\t       \"%s\\n(use --cached to keep the file, or -f to \"\n+\t\t\t       \"force removal)\"), files_local.buf);\n+\n \treturn errs;\n }\n \ndiff --git a/t/t3600-rm.sh b/t/t3600-rm.sh\nindex 0c44e9f..e0f3166 100755\n--- a/t/t3600-rm.sh\n+++ b/t/t3600-rm.sh\n@@ -687,4 +687,49 @@ test_expect_failure SYMLINKS 'rm across a symlinked leading path (w/ index)' '\n \ttest_path_is_file e/f\n '\n \n+test_expect_success 'setup for testing rm messages' '\n+\t>bar.txt &&\n+\t>foo.txt &&\n+\tgit add bar.txt foo.txt\n+'\n+\n+test_expect_success 'rm files with different staged content' '\n+\tcat >expect << EOF &&\n+error: the following files have staged content different from both the\n+file and the HEAD:\n+\tbar.txt\n+\tfoo.txt\n+(use -f to force removal)\n+EOF\n+\techo content1 >foo.txt &&\n+\techo content1 >bar.txt &&\n+\ttest_must_fail git rm foo.txt bar.txt 2>actual &&\n+\ttest_cmp expect actual\n+'\n+\n+test_expect_success 'rm file with local modification' '\n+\tcat >expect << EOF &&\n+error: the following files have local modifications:\n+\tfoo.txt\n+(use --cached to keep the file, or -f to force removal)\n+EOF\n+\tgit commit -m \"testing rm 3\" &&\n+\techo content3 >foo.txt &&\n+\ttest_must_fail git rm foo.txt 2>actual &&\n+\ttest_cmp expect actual\n+'\n+\n+test_expect_success 'rm file with changes in the index' '\n+\tcat >expect << EOF &&\n+error: the following files have changes staged in the index:\n+\tfoo.txt\n+(use --cached to keep the file, or -f to force removal)\n+EOF\n+\tgit reset --hard &&\n+\techo content5 >foo.txt &&\n+\tgit add foo.txt &&\n+\ttest_must_fail git rm foo.txt 2>actual &&\n+\ttest_cmp expect actual\n+'\n+\n test_done\n-- \n1.7.8\n"},{"id":"219788","messageId":"1370680434-2709-2-git-send-email-Mathieu.Lienard--Mayor@ensimag.imag.fr","threadId":"34063","inReplyTo":"1370680434-2709-1-git-send-email-Mathieu.Lienard--Mayor@ensimag.imag.fr","subject":"[PATCH 2/2] rm: introduce advice.rmHints to shorten messages","fromName":"Mathieu Lienard--Mayor","fromEmail":"mathieu.lienard--mayor@ensimag.imag.fr","sentAt":"2013-06-08T08:33:54Z","receivedAt":"2013-06-08T08:33:54Z","isPatch":true,"sender":{"key":"mathieu.lienard--mayor@ensimag.imag.fr","avatar":null},"body":"From: Mathieu Liénard--Mayor <Mathieu.Lienard--Mayor@ensimag.imag.fr>\n\nSimilarly to advice.*, advice.rmHints has been added\nto the config variables. By default, it is set to false, in order to\nkeep the messages the same as before. When set to true,  advice\nare no longer included in the error messages.\n\nAs an example, the message:\n\terror: 'foo.txt' has changes staged in the index\n\t(use --cached to keep the file, or -f to force removal)\n\nwould look like, with advice.rmHints=true:\n\terror: 'foo.txt' has changes staged in the index\n\nSigned-off-by: Mathieu Lienard--Mayor <Mathieu.Lienard--Mayor@ensimag.imag.fr>\nSigned-off-by: Jorge Juan Garcia Garcia <Jorge-Juan.garcia-Garcia@ensimag.imag.fr>\nSigned-off-by: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>\n---\n Documentation/config.txt |    3 +++\n advice.c                 |    2 ++\n advice.h                 |    1 +\n builtin/rm.c             |   38 ++++++++++++++++++++++++++------------\n t/t3600-rm.sh            |   32 ++++++++++++++++++++++++++++++++\n 5 files changed, 64 insertions(+), 12 deletions(-)\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex 6e53fc5..eb04479 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -199,6 +199,9 @@ advice.*::\n \tamWorkDir::\n \t\tAdvice that shows the location of the patch file when\n \t\tlinkgit:git-am[1] fails to apply it.\n+\trmHints::\n+\t\tIn case of failure in the output of linkgit:git-rm[1],\n+\t\tshow directions on how to proceed from the current state.\n --\n \n core.fileMode::\ndiff --git a/advice.c b/advice.c\nindex a8deee6..a4c169c 100644\n--- a/advice.c\n+++ b/advice.c\n@@ -14,6 +14,7 @@ int advice_resolve_conflict = 1;\n int advice_implicit_identity = 1;\n int advice_detached_head = 1;\n int advice_set_upstream_failure = 1;\n+int advice_rm_hints = 1;\n \n static struct {\n \tconst char *name;\n@@ -33,6 +34,7 @@ static struct {\n \t{ \"implicitidentity\", &advice_implicit_identity },\n \t{ \"detachedhead\", &advice_detached_head },\n \t{ \"setupstreamfailure\", &advice_set_upstream_failure },\n+\t{ \"rmhints\", &advice_rm_hints },\n \n \t/* make this an alias for backward compatibility */\n \t{ \"pushnonfastforward\", &advice_push_update_rejected }\ndiff --git a/advice.h b/advice.h\nindex 94caa32..36104c4 100644\n--- a/advice.h\n+++ b/advice.h\n@@ -17,6 +17,7 @@ extern int advice_resolve_conflict;\n extern int advice_implicit_identity;\n extern int advice_detached_head;\n extern int advice_set_upstream_failure;\n+extern int advice_rm_hints;\n \n int git_default_advice_config(const char *var, const char *value);\n void advise(const char *advice, ...);\ndiff --git a/builtin/rm.c b/builtin/rm.c\nindex 5b2abd2..38ceb73 100644\n--- a/builtin/rm.c\n+++ b/builtin/rm.c\n@@ -62,9 +62,11 @@ static int check_submodules_use_gitfiles(void)\n \n \t\tif (!submodule_uses_gitfile(name))\n \t\t\terrs = error(_(\"submodule '%s' (or one of its nested \"\n-\t\t\t\t     \"submodules) uses a .git directory\\n\"\n-\t\t\t\t     \"(use 'rm -rf' if you really want to remove \"\n-\t\t\t\t     \"it including all of its history)\"), name);\n+\t\t\t\t       \"submodules) uses a .git directory%s\"), name,\n+\t\t\t\t       advice_rm_hints\n+\t\t\t\t       ? \"\\n(use 'rm -rf' if you really want to remove \"\n+\t\t\t\t       \"it including all of its history)\"\n+\t\t\t\t       : \"\");\n \t}\n \n \treturn errs;\n@@ -200,21 +202,33 @@ static int check_local_mod(unsigned char *head, int index_only)\n \n \tif (files_staged.len)\n \t\terrs = error(_(\"the following files have staged content \"\n-\t\t\t       \"different from both the\\nfileand the HEAD:%s\\n\"\n-\t\t\t       \"(use -f to force removal)\"), files_staged.buf);\n+\t\t\t       \"different from both the\\nfile and the HEAD:%s%s\"\n+\t\t\t       ), files_staged.buf,\n+\t\t\t       advice_rm_hints\n+\t\t\t       ? \"\\n(use -f to force removal)\"\n+\t\t\t       : \"\");\n \tif (files_cached.len)\n \t\terrs = error(_(\"the following files have changes staged \"\n-\t\t\t       \"in the index:%s\\n(use --cached to keep the file, \"\n-\t\t\t       \"or -f to force removal)\"), files_cached.buf);\n+\t\t\t       \"in the index:%s%s\"), files_cached.buf,\n+\t\t\t       advice_rm_hints\n+\t\t\t       ? \"\\n(use --cached to keep the file, \"\n+\t\t\t       \"or -f to force removal)\"\n+\t\t\t       : \"\");\n \tif (files_submodule.len)\n \t\terrs = error(_(\"the following submodules (or one of its nested \"\n-\t\t\t       \"submodule) use a .git directory:%s\\n\"\n-\t\t\t       \"(use 'rm -rf' if you really want to remove \"\n-\t\t\t       \"it including all of its history)\"), files_submodule.buf);\n+\t\t\t       \"submodule) use a .git directory:%s%s\"),\n+\t\t\t       files_submodule.buf,\n+\t\t\t       advice_rm_hints\n+\t\t\t       ? \"\\n(use 'rm -rf' if you really want to remove \"\n+\t\t\t       \"it including all of its history)\"\n+\t\t\t       : \"\");\n \tif (files_local.len)\n \t\terrs = error(_(\"the following files have local modifications:\"\n-\t\t\t       \"%s\\n(use --cached to keep the file, or -f to \"\n-\t\t\t       \"force removal)\"), files_local.buf);\n+\t\t\t       \"%s%s\"), files_local.buf,\n+\t\t\t       advice_rm_hints\n+\t\t\t       ? \"\\n(use --cached to keep the file, or -f to \"\n+\t\t\t       \"force removal)\"\n+\t\t\t       : \"\");\n \n \treturn errs;\n }\ndiff --git a/t/t3600-rm.sh b/t/t3600-rm.sh\nindex e0f3166..ab10cc6 100755\n--- a/t/t3600-rm.sh\n+++ b/t/t3600-rm.sh\n@@ -707,6 +707,19 @@ EOF\n \ttest_cmp expect actual\n '\n \n+test_expect_success 'rm files with different staged content without hints' '\n+\tcat >expect << EOF &&\n+error: the following files have staged content different from both the\n+file and the HEAD:\n+\tbar.txt\n+\tfoo.txt\n+EOF\n+\techo content2 >foo.txt &&\n+\techo content2 >bar.txt &&\n+\ttest_must_fail git -c advice.rmhints=false rm foo.txt bar.txt 2>actual &&\n+\ttest_cmp expect actual\n+'\n+\n test_expect_success 'rm file with local modification' '\n \tcat >expect << EOF &&\n error: the following files have local modifications:\n@@ -719,6 +732,16 @@ EOF\n \ttest_cmp expect actual\n '\n \n+test_expect_success 'rm file with local modification without hints' '\n+\tcat >expect << EOF &&\n+error: the following files have local modifications:\n+\tbar.txt\n+EOF\n+\techo content4 >bar.txt &&\n+\ttest_must_fail git -c advice.rmhints=false rm bar.txt 2>actual &&\n+\ttest_cmp expect actual\n+'\n+\n test_expect_success 'rm file with changes in the index' '\n \tcat >expect << EOF &&\n error: the following files have changes staged in the index:\n@@ -732,4 +755,13 @@ EOF\n \ttest_cmp expect actual\n '\n \n+test_expect_success 'rm file with changes in the index without hints' '\n+\tcat >expect << EOF &&\n+error: the following files have changes staged in the index:\n+\tfoo.txt\n+EOF\n+\ttest_must_fail git -c advice.rmhints=false rm foo.txt 2>actual &&\n+\ttest_cmp expect actual\n+'\n+\n test_done\n-- \n1.7.8\n"},{"id":"219822","messageId":"CALkWK0mqVCfrPgSLi1dnDv26YAyRrJJD_S179VYfEApmGkd4Uw@mail.gmail.com","threadId":"34063","inReplyTo":"1370680434-2709-1-git-send-email-Mathieu.Lienard--Mayor@ensimag.imag.fr","subject":"Re: [PATCH 1/2] rm: better error message on failure for multiple files","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2013-06-08T13:51:56Z","receivedAt":"2013-06-08T13:51:56Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Mathieu Lienard--Mayor wrote:\n> @@ -170,30 +175,47 @@ static int check_local_mod(unsigned char *head, int index_only)\n>                  * \"intent to add\" entry.\n>                  */\n>                 if (local_changes && staged_changes) {\n> -                       if (!index_only || !(ce->ce_flags & CE_INTENT_TO_ADD))\n> -                               errs = error(_(\"'%s' has staged content different \"\n> -                                            \"from both the file and the HEAD\\n\"\n> -                                            \"(use -f to force removal)\"), name);\n> +                       if (!index_only || !(ce->ce_flags & CE_INTENT_TO_ADD)) {\n> +                               strbuf_addstr(&files_staged, \"\\n        \");\n\nOuch.  Wouldn't a string-list be more appropriate for this kind of thing?\n"},{"id":"219824","messageId":"CALkWK0==9aN1wVoSXENvTJHOT8bd2SYrEFxrmTdhzMxB3mHPCQ@mail.gmail.com","threadId":"34063","inReplyTo":"1370680434-2709-2-git-send-email-Mathieu.Lienard--Mayor@ensimag.imag.fr","subject":"Re: [PATCH 2/2] rm: introduce advice.rmHints to shorten messages","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2013-06-08T14:01:42Z","receivedAt":"2013-06-08T14:01:42Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Mathieu Lienard--Mayor wrote:\n> As an example, the message:\n>         error: 'foo.txt' has changes staged in the index\n>         (use --cached to keep the file, or -f to force removal)\n>\n> would look like, with advice.rmHints=true:\n>         error: 'foo.txt' has changes staged in the index\n\nUm, have you switched the true with false?  advice.* variables are\ntrue by default, and I turn off all of them.\n\nAlso, I think you can extend this to also remove add-advice.  Why\nwould someone want to turn off advice from rm, but not add?  (Unsure\nabout this)\n\n> Similarly to advice.*, advice.rmHints has been added\n> to the config variables. By default, it is set to false, in order to\n> keep the messages the same as before. When set to true,  advice\n> are no longer included in the error messages.\n\nUgh, why this roundabout-passive-past tone?  Use imperative tone like this:\n\nIntroduce advice.rmHints to control the whether to display advice when\nusing 'git rm'.  Defaults to true, preserving current behavior.\n"},{"id":"220250","messageId":"f3f6cb36e56ea8fdf7ebe22230c2aff7@ensibm.imag.fr","threadId":"34063","inReplyTo":"CALkWK0mqVCfrPgSLi1dnDv26YAyRrJJD_S179VYfEApmGkd4Uw@mail.gmail.com","subject":"Re: [PATCH 1/2] rm: better error message on failure for multiple files","fromName":"Mathieu Liénard--Mayor","fromEmail":"mathieu.lienard--mayor@ensimag.fr","sentAt":"2013-06-10T07:43:44Z","receivedAt":"2013-06-10T07:43:44Z","isPatch":true,"sender":{"key":"mathieu.lienard--mayor@ensimag.fr","avatar":null},"body":"Once again, thanks a lot your feedback, we appreciate it a lot!\nLe 2013-06-08 15:51, Ramkumar Ramachandra a écrit :\n> Mathieu Lienard--Mayor wrote:\n>> @@ -170,30 +175,47 @@ static int check_local_mod(unsigned char \n>> *head, int index_only)\n>>                  * \"intent to add\" entry.\n>>                  */\n>>                 if (local_changes && staged_changes) {\n>> -                       if (!index_only || !(ce->ce_flags & \n>> CE_INTENT_TO_ADD))\n>> -                               errs = error(_(\"'%s' has staged \n>> content different \"\n>> -                                            \"from both the file and \n>> the HEAD\\n\"\n>> -                                            \"(use -f to force \n>> removal)\"), name);\n>> +                       if (!index_only || !(ce->ce_flags & \n>> CE_INTENT_TO_ADD)) {\n>> +                               strbuf_addstr(&files_staged, \"\\n     \n>>   \");\n>\n> Ouch.  Wouldn't a string-list be more appropriate for this kind of \n> thing?\nMatthieu Moy told me string-list would be better aswell, so we're gonna \nchange it.\n\n-- \nMathieu Liénard--Mayor,\n2nd year at Grenoble INP - ENSIMAG\n(+33)6 80 56 30 02\n"},{"id":"220252","messageId":"19969d9996306bf0e7ac6351d4ad435d@ensibm.imag.fr","threadId":"34063","inReplyTo":"CALkWK0==9aN1wVoSXENvTJHOT8bd2SYrEFxrmTdhzMxB3mHPCQ@mail.gmail.com","subject":"Re: [PATCH 2/2] rm: introduce advice.rmHints to shorten messages","fromName":"Mathieu Liénard--Mayor","fromEmail":"mathieu.lienard--mayor@ensimag.fr","sentAt":"2013-06-10T07:52:25Z","receivedAt":"2013-06-10T07:52:25Z","isPatch":true,"sender":{"key":"mathieu.lienard--mayor@ensimag.fr","avatar":null},"body":"Le 2013-06-08 16:01, Ramkumar Ramachandra a écrit :\n> Mathieu Lienard--Mayor wrote:\n>> As an example, the message:\n>>         error: 'foo.txt' has changes staged in the index\n>>         (use --cached to keep the file, or -f to force removal)\n>>\n>> would look like, with advice.rmHints=true:\n>>         error: 'foo.txt' has changes staged in the index\n>\n> Um, have you switched the true with false?  advice.* variables are\n> true by default, and I turn off all of them.\nWhoops, my bad, I obviously meant false.\n>\n> Also, I think you can extend this to also remove add-advice.  Why\n> would someone want to turn off advice from rm, but not add?  (Unsure\n> about this)\nI'm not so sure i understand. Do you mean rmHints should deactivate \naddHints aswell, or do you mean that since we're introducing rmHints it \nwould be natural to introduce addHints ?\n>\n>> Similarly to advice.*, advice.rmHints has been added\n>> to the config variables. By default, it is set to false, in order to\n>> keep the messages the same as before. When set to true,  advice\n>> are no longer included in the error messages.\n>\n> Ugh, why this roundabout-passive-past tone?  Use imperative tone like \n> this:\nSorry about that, we'll work on it.\n>\n> Introduce advice.rmHints to control the whether to display advice \n> when\n> using 'git rm'.  Defaults to true, preserving current behavior.\n-- \nMathieu Liénard--Mayor,\n2nd year at Grenoble INP - ENSIMAG\n(+33)6 80 56 30 02\n"},{"id":"220254","messageId":"CALkWK0n+yF-kRahgsQQuT-+QiT5gy=J_Bdati=uooiW0djQrgw@mail.gmail.com","threadId":"34063","inReplyTo":"19969d9996306bf0e7ac6351d4ad435d@ensibm.imag.fr","subject":"Re: [PATCH 2/2] rm: introduce advice.rmHints to shorten messages","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2013-06-10T07:55:21Z","receivedAt":"2013-06-10T07:55:21Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Mathieu Liénard--Mayor wrote:\n> I'm not so sure i understand. Do you mean rmHints should deactivate addHints\n> aswell, or do you mean that since we're introducing rmHints it would be\n> natural to introduce addHints ?\n\nMore the latter, but I'm tilting towards addRmHints (or something)\nwhich affects both add and rm hints.\n\n> Sorry about that, we'll work on it.\n\nNothing to be sorry about.  You're doing good work, and we're helping\nyou make it even better :)\n"},{"id":"220257","messageId":"vpqvc5mqspn.fsf@anie.imag.fr","threadId":"34063","inReplyTo":"CALkWK0n+yF-kRahgsQQuT-+QiT5gy=J_Bdati=uooiW0djQrgw@mail.gmail.com","subject":"Re: [PATCH 2/2] rm: introduce advice.rmHints to shorten messages","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2013-06-10T08:24:04Z","receivedAt":"2013-06-10T08:24:04Z","isPatch":true,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Ramkumar Ramachandra <artagnon@gmail.com> writes:\n\n> Mathieu Liénard--Mayor wrote:\n>> I'm not so sure i understand. Do you mean rmHints should deactivate addHints\n>> aswell, or do you mean that since we're introducing rmHints it would be\n>> natural to introduce addHints ?\n>\n> More the latter, but I'm tilting towards addRmHints (or something)\n> which affects both add and rm hints.\n\nI don't see why add and rm hints should be correlated, or I don't have\nthe same advice as you in mind.\n\n$ git add foo.txt\nThe following paths are ignored by one of your .gitignore files:\nfoo.txt\nUse -f if you really want to add them.\nfatal: no files added\n\n$ git rm foo.txt \nerror: 'foo.txt' has changes staged in the index\n(use --cached to keep the file, or -f to force removal)\n\nBoth have completely different meanings: the first is about .gitignore,\nand the second about not loosing data.\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"220258","messageId":"CALkWK0kzGDrAqTL6dY65OD9Q0ax+nqGULsABqgMzEEXga52XqA@mail.gmail.com","threadId":"34063","inReplyTo":"vpqvc5mqspn.fsf@anie.imag.fr","subject":"Re: [PATCH 2/2] rm: introduce advice.rmHints to shorten messages","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2013-06-10T08:26:45Z","receivedAt":"2013-06-10T08:26:45Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Matthieu Moy wrote:\n> I don't see why add and rm hints should be correlated, or I don't have\n> the same advice as you in mind.\n>\n> Both have completely different meanings: the first is about .gitignore,\n> and the second about not loosing data.\n\nRight, my bad.  Please continue with rmHints, and optionally write an\naddHints while at it.\n"},{"id":"220271","messageId":"51B5B876.3070903@ensimag.fr","threadId":"34063","inReplyTo":"1370680434-2709-1-git-send-email-Mathieu.Lienard--Mayor@ensimag.imag.fr","subject":"Re: [PATCH 1/2] rm: better error message on failure for multiple files","fromName":"Célestin Matte","fromEmail":"celestin.matte@ensimag.fr","sentAt":"2013-06-10T11:28:54Z","receivedAt":"2013-06-10T11:28:54Z","isPatch":true,"sender":{"key":"celestin.matte@ensimag.fr","avatar":"https://avatars.githubusercontent.com/u/2753554?v=4"},"body":"Le 08/06/2013 10:33, Mathieu Lienard--Mayor a écrit :\n> +\tif (files_staged.len)\n> +\t\terrs = error(_(\"the following files have staged content \"\n> +\t\t\t       \"different from both the\\nfileand the HEAD:%s\\n\"\n> +\t\t\t       \"(use -f to force removal)\"), files_staged.buf);\n\nTypo here: \"fileand\" -> \"file and\"\n\n-- \nCélestin Matte\n"}]}