aboutsummaryrefslogtreecommitdiff
path: root/builtin/rm.c
diff options
context:
space:
mode:
authorMathieu Lienard--Mayor <Mathieu.Lienard--Mayor@ensimag.imag.fr>2013-06-12 10:06:44 +0200
committerJunio C Hamano <gitster@pobox.com>2013-06-12 16:59:55 -0700
commit7e30944622573ebdf87beed057b098af7360234c (patch)
treef955e84c0c9f38db34106ad261a6ceaff4153354 /builtin/rm.c
parent914dc0289d1df75cfa744cea8ec84cb529cbc791 (diff)
downloadgit-7e30944622573ebdf87beed057b098af7360234c.tar.gz
git-7e30944622573ebdf87beed057b098af7360234c.tar.xz
rm: introduce advice.rmHints to shorten messages
Introduce advice.rmHints to choose whether to display advice or not when git rm fails. Defaults to true, in order to preserve current behavior. As an example, the message: error: 'foo.txt' has changes staged in the index (use --cached to keep the file, or -f to force removal) would look like, with advice.rmHints=false: error: 'foo.txt' has changes staged in the index Signed-off-by: Mathieu Lienard--Mayor <Mathieu.Lienard--Mayor@ensimag.imag.fr> Signed-off-by: Jorge Juan Garcia Garcia <Jorge-Juan.Garcia-Garcia@ensimag.imag.fr> Signed-off-by: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/rm.c')
-rw-r--r--builtin/rm.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/builtin/rm.c b/builtin/rm.c
index 5d0c0683d..06025a2e7 100644
--- a/builtin/rm.c
+++ b/builtin/rm.c
@@ -51,7 +51,8 @@ static void print_error_files(struct string_list *files_list,
strbuf_addf(&err_msg,
"\n %s",
files_list->items[i].string);
- strbuf_addstr(&err_msg, hints_msg);
+ if (advice_rm_hints)
+ strbuf_addstr(&err_msg, hints_msg);
*errs = error("%s", err_msg.buf);
strbuf_release(&err_msg);
}