@matheusbsbs / matheus-bagliano / commits / 18076502cb
Fork 0

git submodule: ignore dirty submodules for summary and status

The summary and status commands only care about submodule commits, so it is rather pointless that they check for dirty work trees. This saves the time needed to scan the submodules work tree. Even "git status" profits from these savings when the status.submodulesummary config option is set, as this lead to traversing the submodule work trees twice, once for status and once again for the submodule summary. And if the submodule was just dirty, submodule summary produced rather meaningless output anyway: * sub 1234567...1234567 (0): Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jens Lehmann committed Jun 25, 2010 at 16:56 UTC 18076502cb282482f3cd75d766e1478cc3fccc29
1 file changed +3 -3
git-submodule.sh
+3 -3
@@ -578,7 +578,7 @@ cmd_summary() {
578
579 cd_to_toplevel
580 # Get modified modules cared by user
581 - modules=$(git $diff_cmd $cached --raw $head -- "$@" |
581 + modules=$(git $diff_cmd $cached --ignore-submodules=dirty --raw $head -- "$@" |
582 sane_egrep '^:([0-7]* )?160000' |
583 while read mod_src mod_dst sha1_src sha1_dst status name
584 do
@@ -592,7 +592,7 @@ cmd_summary() {
592
593 test -z "$modules" && return
594
595 - git $diff_cmd $cached --raw $head -- $modules |
595 + git $diff_cmd $cached --ignore-submodules=dirty --raw $head -- $modules |
596 sane_egrep '^:([0-7]* )?160000' |
597 cut -c2- |
598 while read mod_src mod_dst sha1_src sha1_dst status name
@@ -758,7 +758,7 @@ cmd_status()
758 continue;
759 fi
760 set_name_rev "$path" "$sha1"
761 - if git diff-files --quiet -- "$path"
761 + if git diff-files --ignore-submodules=dirty --quiet -- "$path"
762 then
763 say " $sha1 $displaypath$revname"
764 else