Re: [PATCH] Don't do status in submodules if status.SubmoduleSummary unset

Previous thread: [PATCH 0/6 v2] Make git log --graph looks better with -p and other diff options by Bo Yang on Thursday, May 20, 2010 - 3:25 am. (10 messages)

Next thread: HIGHLY CONFIDENTIAL by Ming Yang on Thursday, May 20, 2010 - 7:25 am. (1 message)
From: Alex Riesen
Date: Thursday, May 20, 2010 - 7:12 am

Noticed-by: Andy Parkins
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>

--


Maybe because we do a (kind of) gentle status run on submodules
whether the status.SubmoduleSummary set or not. Usually a background
run of "git status" for every submodules goes unnoticed, just
sometimes a submodule is a little too big.

I tried this, but feels like a bit of overkill.

diff --git a/wt-status.c b/wt-status.c
index 8ca59a2..d5bcdf9 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -303,7 +303,10 @@ static void
wt_status_collect_changes_worktree(struct wt_status *s)
 	init_revisions(&rev, NULL);
 	setup_revisions(0, NULL, &rev, NULL);
 	rev.diffopt.output_format |= DIFF_FORMAT_CALLBACK;
-	DIFF_OPT_SET(&rev.diffopt, DIRTY_SUBMODULES);
+	if (s->submodule_summary)
+		DIFF_OPT_SET(&rev.diffopt, DIRTY_SUBMODULES);
+	else
+		DIFF_OPT_SET(&rev.diffopt, IGNORE_SUBMODULES);
 	if (!s->show_untracked_files)
 		DIFF_OPT_SET(&rev.diffopt, IGNORE_UNTRACKED_IN_SUBMODULES);
 	rev.diffopt.format_callback = wt_status_collect_changed_cb;
From: Jens Lehmann
Date: Thursday, May 20, 2010 - 10:45 am

Yup, because checking a submodule for its dirtiness has to be done

This patch seems to disable submodule output completely for the default
case (when status.SubmoduleSummary is false) and breaks 17 test cases.


--

From: Alex Riesen
Date: Thursday, May 20, 2010 - 12:34 pm

That's why I said it feels like overkill
--

From: Jens Lehmann
Date: Thursday, May 20, 2010 - 1:14 pm

Because summary output only describes what commits happened in the
submodule (that operation is rather cheap). The status run is done
to tell what changes in the submodules work tree have occurred since

I just wanted to confirm your feeling ;-)
--

Previous thread: [PATCH 0/6 v2] Make git log --graph looks better with -p and other diff options by Bo Yang on Thursday, May 20, 2010 - 3:25 am. (10 messages)

Next thread: HIGHLY CONFIDENTIAL by Ming Yang on Thursday, May 20, 2010 - 7:25 am. (1 message)