git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC/RFD] wt-status: take advice.statusHints seriously
@ 2010-04-21 14:47 Michael J Gruber
  2010-04-22  7:48 ` Junio C Hamano
  0 siblings, 1 reply; 9+ messages in thread
From: Michael J Gruber @ 2010-04-21 14:47 UTC (permalink / raw)
  To: git

Currently, status gives a lot of hints even when advice.statusHints is
false. Change this so that all hints depend on the config varaible.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
---
 wt-status.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/wt-status.c b/wt-status.c
index 8ca59a2..38076ee 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -625,7 +625,7 @@ void wt_status_print(struct wt_status *s)
 	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);
@@ -635,15 +635,15 @@ void wt_status_print(struct wt_status *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)" : "");
 	}
 }
 
-- 
1.7.1.rc1.248.gcefbb

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2010-04-26 19:11 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-21 14:47 [RFC/RFD] wt-status: take advice.statusHints seriously Michael J Gruber
2010-04-22  7:48 ` Junio C Hamano
2010-04-22 20:30   ` [PATCH 1/2] t7508: test advice.statusHints Michael J Gruber
2010-04-22 20:30     ` [PATCH 2/2] wt-status: take advice.statusHints seriously Michael J Gruber
2010-04-23  4:15       ` Tay Ray Chuan
2010-04-23  8:09         ` Michael J Gruber
2010-04-23 18:31           ` Jakub Narebski
2010-04-26 19:10           ` Jeff King
2010-04-26 19:10       ` Jeff King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).