diff options
author | Junio C Hamano <gitster@pobox.com> | 2014-06-16 10:07:19 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-06-16 10:07:19 -0700 |
commit | 6d681f0a3e1fd10d4f51df3a90af30f4de299f89 (patch) | |
tree | 7a75a1e154a3e5077a100199f07260a040c245b6 /wt-status.c | |
parent | 83a4904fad91c2de92140d344bee9912e89ee7d9 (diff) | |
parent | c215d3d2826c882feb819e5743287ec74d9ff693 (diff) | |
download | git-6d681f0a3e1fd10d4f51df3a90af30f4de299f89.tar.gz |
Merge branch 'jl/status-added-submodule-is-never-ignored'
submodule.*.ignore and diff.ignoresubmodules are used to ignore all
submodule changes in "diff" output, but it can be confusing to
apply these configuration values to status and commit.
This is a backward-incompatible change, but should be so in a good
way (aka bugfix).
* 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.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/wt-status.c b/wt-status.c index b8841e1dca..318a191238 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; |