git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Don't do status in submodules if status.SubmoduleSummary  unset
@ 2010-05-20 14:12 Alex Riesen
  2010-05-20 17:45 ` Jens Lehmann
  0 siblings, 1 reply; 4+ messages in thread
From: Alex Riesen @ 2010-05-20 14:12 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Andy Parkins, git

[-- Attachment #1: Type: text/plain, Size: 1214 bytes --]

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

--

On Thu, May 20, 2010 at 15:28, Junio C Hamano <gitster@pobox.com> wrote:
> As to the not-working-configuration I don't remember the codepath well, so
> sorry but no answer from me right now.

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;

[-- Attachment #2: ignore-submodules.patch --]
[-- Type: application/octet-stream, Size: 959 bytes --]

From 6b7a5e0ac560e1187d8ff359bad8c04927d0b599 Mon Sep 17 00:00:00 2001
From: Alex Riesen <raa.lkml@gmail.com>
Date: Thu, 20 May 2010 16:04:11 +0200
Subject: [PATCH] Don't do status in submodules if status.SubmoduleSummary unset

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

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;

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] Don't do status in submodules if status.SubmoduleSummary unset
  2010-05-20 14:12 [PATCH] Don't do status in submodules if status.SubmoduleSummary unset Alex Riesen
@ 2010-05-20 17:45 ` Jens Lehmann
  2010-05-20 19:34   ` Alex Riesen
  0 siblings, 1 reply; 4+ messages in thread
From: Jens Lehmann @ 2010-05-20 17:45 UTC (permalink / raw)
  To: Alex Riesen; +Cc: Junio C Hamano, Andy Parkins, git

Am 20.05.2010 16:12, schrieb Alex Riesen:
> Maybe because we do a (kind of) gentle status run on submodules
> whether the status.SubmoduleSummary set or not.

Yup, because checking a submodule for its dirtiness has to be done
no matter if the summary output is also wanted.


> 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.

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

So no thumbs up from me ;-)


> 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;

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Don't do status in submodules if status.SubmoduleSummary  unset
  2010-05-20 17:45 ` Jens Lehmann
@ 2010-05-20 19:34   ` Alex Riesen
  2010-05-20 20:14     ` Jens Lehmann
  0 siblings, 1 reply; 4+ messages in thread
From: Alex Riesen @ 2010-05-20 19:34 UTC (permalink / raw)
  To: Jens Lehmann; +Cc: Junio C Hamano, Andy Parkins, git

On Thu, May 20, 2010 at 19:45, Jens Lehmann <Jens.Lehmann@web.de> wrote:
> Am 20.05.2010 16:12, schrieb Alex Riesen:
>> Maybe because we do a (kind of) gentle status run on submodules
>> whether the status.SubmoduleSummary set or not.
>
> Yup, because checking a submodule for its dirtiness has to be done
> no matter if the summary output is also wanted.

Yeah. Why?

>> 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.
>
> This patch seems to disable submodule output completely for the default
> case (when status.SubmoduleSummary is false) and breaks 17 test cases.

That's why I said it feels like overkill

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Don't do status in submodules if status.SubmoduleSummary unset
  2010-05-20 19:34   ` Alex Riesen
@ 2010-05-20 20:14     ` Jens Lehmann
  0 siblings, 0 replies; 4+ messages in thread
From: Jens Lehmann @ 2010-05-20 20:14 UTC (permalink / raw)
  To: Alex Riesen; +Cc: Junio C Hamano, Andy Parkins, git

Am 20.05.2010 21:34, schrieb Alex Riesen:
> On Thu, May 20, 2010 at 19:45, Jens Lehmann <Jens.Lehmann@web.de> wrote:
>> Am 20.05.2010 16:12, schrieb Alex Riesen:
>>> Maybe because we do a (kind of) gentle status run on submodules
>>> whether the status.SubmoduleSummary set or not.
>>
>> Yup, because checking a submodule for its dirtiness has to be done
>> no matter if the summary output is also wanted.
> 
> Yeah. Why?

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
the last commit there (and for that we have to scan the whole tree).


>>> 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.
>>
>> This patch seems to disable submodule output completely for the default
>> case (when status.SubmoduleSummary is false) and breaks 17 test cases.
> 
> That's why I said it feels like overkill

I just wanted to confirm your feeling ;-)

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-05-20 20:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-20 14:12 [PATCH] Don't do status in submodules if status.SubmoduleSummary unset Alex Riesen
2010-05-20 17:45 ` Jens Lehmann
2010-05-20 19:34   ` Alex Riesen
2010-05-20 20:14     ` Jens Lehmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).