aboutsummaryrefslogtreecommitdiff
path: root/wt-status.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-05-21 04:02:23 -0700
committerJunio C Hamano <gitster@pobox.com>2010-05-21 04:02:23 -0700
commit82e7ee7351d6e328294016d3b99825d8001abd24 (patch)
tree4940740a6f217d1c9f0abc415766a3a690e627fc /wt-status.c
parentb7ef48d5d5f0d5b912a5ca84a7079803387586ae (diff)
parent980bde389491e65df3a6f26f755064013b65740c (diff)
downloadgit-82e7ee7351d6e328294016d3b99825d8001abd24.tar.gz
git-82e7ee7351d6e328294016d3b99825d8001abd24.tar.xz
Merge branch 'mg/advice-statushints'
* mg/advice-statushints: wt-status: take advice.statusHints seriously t7508: test advice.statusHints Conflicts: wt-status.c
Diffstat (limited to 'wt-status.c')
-rw-r--r--wt-status.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/wt-status.c b/wt-status.c
index 84a9002b8..14e0acce8 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -651,7 +651,9 @@ void wt_status_print(struct wt_status *s)
if (s->show_ignored_files)
wt_status_print_other(s, &s->ignored, "Ignored", "add -f");
} 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);
@@ -661,15 +663,22 @@ 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)" : "");
}
}