Re: [PATCH 2/2] status: don't ignore submodules added to index
- From
Jens Lehmann <jens.lehmann@web.de>
- Date
- Mar 29, 2014, 23:16 UTC
- Message-ID
- <53375447.2050502@web.de>
- In-Reply-To
- <53374F82.3020800@gmail.com>
Am 29.03.2014 23:56, schrieb Ronald Weiss:
Show 9 quoted lines
> Submodules explicitly added to index by user should be never hidden in > status output. > > This also fixes a bug in commit, where submodules with configured ignore > setting (in .gitmodules or .git/config), added to index by user, are not > displayed in the commit message as being commited, but they still are > commited. Unless the changed submodules are the only changes in the index, > in such case commit fails immediately with "no changes", which is even > worse.
Thanks, but I think this patch falls a bit short (I assume you should see test failures with this patch). I'm currently working on fixing that, will post that as soon as I finished it.
Show 23 quoted lines
> Signed-off-by: Ronald Weiss <weiss.ronald@gmail.com>
> ---
> wt-status.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/wt-status.c b/wt-status.c
> index a452407..108a048 100644
> --- a/wt-status.c
> +++ b/wt-status.c
> @@ -486,10 +486,8 @@ 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);
>
> - if (s->ignore_submodule_arg) {
> - DIFF_OPT_SET(&rev.diffopt, OVERRIDE_SUBMODULE_CONFIG);
> - handle_ignore_submodules_arg(&rev.diffopt, s->ignore_submodule_arg);
> - }
> + DIFF_OPT_SET(&rev.diffopt, OVERRIDE_SUBMODULE_CONFIG);
> + DIFF_OPT_CLR(&rev.diffopt, IGNORE_SUBMODULES);
>
> rev.diffopt.output_format |= DIFF_FORMAT_CALLBACK;
> rev.diffopt.format_callback = wt_status_collect_updated_cb;
>