summaryrefslogtreecommitdiff
path: root/wt-status.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-06-25 18:50:03 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-06-25 18:50:03 (GMT)
commit287a8701f6fe263696e9c74a3a2020f4cfbf4239 (patch)
tree865da60d812e652adc675edf32ee2fda851d823d /wt-status.c
parent1881d2b88c4b889dcb95782ad4bc5395808438e9 (diff)
parentc215d3d2826c882feb819e5743287ec74d9ff693 (diff)
downloadgit-287a8701f6fe263696e9c74a3a2020f4cfbf4239.zip
git-287a8701f6fe263696e9c74a3a2020f4cfbf4239.tar.gz
git-287a8701f6fe263696e9c74a3a2020f4cfbf4239.tar.bz2
Merge branch 'jl/status-added-submodule-is-never-ignored' into maint
"git status" (and "git commit") behaved as if changes in a modified submodule are not there if submodule.*.ignore configuration is set, which was misleading. The configuration is only to unclutter diff output during the course of development, and should not to hide changes in the "status" output to cause the users forget to commit them. * jl/status-added-submodule-is-never-ignored: commit -m: commit staged submodules regardless of ignore config status/commit: show staged submodules regardless of ignore config
Diffstat (limited to 'wt-status.c')
-rw-r--r--wt-status.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/wt-status.c b/wt-status.c
index ec7344e..86fec89 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -519,9 +519,19 @@ static void wt_status_collect_changes_index(struct wt_status *s)
opt.def = s->is_initial ? EMPTY_TREE_SHA1_HEX : s->reference;
setup_revisions(0, NULL, &rev, &opt);
+ DIFF_OPT_SET(&rev.diffopt, OVERRIDE_SUBMODULE_CONFIG);
if (s->ignore_submodule_arg) {
- DIFF_OPT_SET(&rev.diffopt, OVERRIDE_SUBMODULE_CONFIG);
handle_ignore_submodules_arg(&rev.diffopt, s->ignore_submodule_arg);
+ } else {
+ /*
+ * Unless the user did explicitly request a submodule ignore
+ * mode by passing a command line option we do not ignore any
+ * changed submodule SHA-1s when comparing index and HEAD, no
+ * matter what is configured. Otherwise the user won't be
+ * shown any submodules she manually added (and which are
+ * staged to be committed), which would be really confusing.
+ */
+ handle_ignore_submodules_arg(&rev.diffopt, "dirty");
}
rev.diffopt.output_format |= DIFF_FORMAT_CALLBACK;