summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 18f3b5a)
raw | patch | inline | side by side (parent: 18f3b5a)
author | Michael J Gruber <git@drmicha.warpmail.net> | |
Thu, 22 Apr 2010 20:30:20 +0000 (22:30 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 6 May 2010 20:22:44 +0000 (13:22 -0700) |
Currently, status gives a lot of hints even when advice.statusHints is
false. Change this so that all hints depend on the config variable.
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
false. Change this so that all hints depend on the config variable.
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t7508-status.sh | patch | blob | history | |
wt-status.c | patch | blob | history |
diff --git a/t/t7508-status.sh b/t/t7508-status.sh
index 7409a06c0b40b511d208430c0506dc8b3a1b2429..1301ec87e929b75717ba69f48b8e3016b56acb6c 100755 (executable)
--- a/t/t7508-status.sh
+++ b/t/t7508-status.sh
# Changed but not updated:
# modified: dir1/modified
#
-# Untracked files not listed (use -u option to show untracked files)
+# Untracked files not listed
EOF
git config advice.statusHints false
test_expect_success 'status -uno (advice.statusHints false)' '
diff --git a/wt-status.c b/wt-status.c
index 8ca59a2d2abec0c9c4629cd4ae7340fcd79a0c7e..d44486c826ee46d258e88c5013d038243aad2756 100644 (file)
--- a/wt-status.c
+++ b/wt-status.c
if (s->show_untracked_files)
wt_status_print_untracked(s);
else if (s->commitable)
- fprintf(s->fp, "# Untracked files not listed (use -u option to show untracked files)\n");
+ fprintf(s->fp, "# Untracked files not listed%s\n",
+ advice_status_hints
+ ? " (use -u option to show untracked files)" : "");
if (s->verbose)
wt_status_print_verbose(s);
else if (s->nowarn)
; /* nothing */
else if (s->workdir_dirty)
- printf("no changes added to commit (use \"git add\" and/or \"git commit -a\")\n");
+ printf("no changes added to commit%s\n",
+ advice_status_hints
+ ? " (use \"git add\" and/or \"git commit -a\")" : "");
else if (s->untracked.nr)
- printf("nothing added to commit but untracked files present (use \"git add\" to track)\n");
+ printf("nothing added to commit but untracked files present%s\n",
+ advice_status_hints
+ ? " (use \"git add\" to track)" : "");
else if (s->is_initial)
- printf("nothing to commit (create/copy files and use \"git add\" to track)\n");
+ printf("nothing to commit%s\n", advice_status_hints
+ ? " (create/copy files and use \"git add\" to track)" : "");
else if (!s->show_untracked_files)
- printf("nothing to commit (use -u to show untracked files)\n");
+ printf("nothing to commit%s\n", advice_status_hints
+ ? " (use -u to show untracked files)" : "");
else
- printf("nothing to commit (working directory clean)\n");
+ printf("nothing to commit%s\n", advice_status_hints
+ ? " (working directory clean)" : "");
}
}