aboutsummaryrefslogtreecommitdiff
path: root/wt-status.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-03-17 16:01:33 -0700
committerJunio C Hamano <gitster@pobox.com>2015-03-17 16:01:33 -0700
commit9bb56e47532db6fb7e97020ffa247ad5c54b1726 (patch)
tree0d7b9f6cef5eae24695d73d75afe3225b4f1dc6e /wt-status.c
parent795b01422da12da3e576fb3468c627b78948b3dc (diff)
parent40555000935147f56896e75b919b25f1f2d23aca (diff)
downloadgit-9bb56e47532db6fb7e97020ffa247ad5c54b1726.tar.gz
git-9bb56e47532db6fb7e97020ffa247ad5c54b1726.tar.xz
Merge branch 'mg/status-v-v'
"git status" now allows the "-v" to be given twice to show the differences that are left in the working tree not to be committed. * mg/status-v-v: commit/status: show the index-worktree diff with -v -v t7508: test git status -v t7508: .gitignore 'expect' and 'output' files
Diffstat (limited to 'wt-status.c')
-rw-r--r--wt-status.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/wt-status.c b/wt-status.c
index 29666d0db..422dc0e70 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -849,6 +849,8 @@ static void wt_status_print_verbose(struct wt_status *s)
{
struct rev_info rev;
struct setup_revision_opt opt;
+ int dirty_submodules;
+ const char *c = color(WT_STATUS_HEADER, s);
init_revisions(&rev, NULL);
DIFF_OPT_SET(&rev.diffopt, ALLOW_TEXTCONV);
@@ -873,7 +875,25 @@ static void wt_status_print_verbose(struct wt_status *s)
rev.diffopt.use_color = 0;
wt_status_add_cut_line(s->fp);
}
+ if (s->verbose > 1 && s->commitable) {
+ /* print_updated() printed a header, so do we */
+ if (s->fp != stdout)
+ wt_status_print_trailer(s);
+ status_printf_ln(s, c, _("Changes to be committed:"));
+ rev.diffopt.a_prefix = "c/";
+ rev.diffopt.b_prefix = "i/";
+ } /* else use prefix as per user config */
run_diff_index(&rev, 1);
+ if (s->verbose > 1 &&
+ wt_status_check_worktree_changes(s, &dirty_submodules)) {
+ status_printf_ln(s, c,
+ "--------------------------------------------------");
+ status_printf_ln(s, c, _("Changes not staged for commit:"));
+ setup_work_tree();
+ rev.diffopt.a_prefix = "i/";
+ rev.diffopt.b_prefix = "w/";
+ run_diff_files(&rev, 0);
+ }
}
static void wt_status_print_tracking(struct wt_status *s)