summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Lehmann <Jens.Lehmann@web.de>2010-06-25 14:56:02 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-06-25 18:12:27 (GMT)
commit18076502cb282482f3cd75d766e1478cc3fccc29 (patch)
tree943b0b388d7d8eb89876d94c196d6423bc355ae3
parent6ed7ddaadba9217b794aecf6d74a2e455daf7a96 (diff)
downloadgit-18076502cb282482f3cd75d766e1478cc3fccc29.zip
git-18076502cb282482f3cd75d766e1478cc3fccc29.tar.gz
git-18076502cb282482f3cd75d766e1478cc3fccc29.tar.bz2
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>
-rwxr-xr-xgit-submodule.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/git-submodule.sh b/git-submodule.sh
index 3319b83..5e7b127 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -578,7 +578,7 @@ cmd_summary() {
cd_to_toplevel
# Get modified modules cared by user
- modules=$(git $diff_cmd $cached --raw $head -- "$@" |
+ modules=$(git $diff_cmd $cached --ignore-submodules=dirty --raw $head -- "$@" |
sane_egrep '^:([0-7]* )?160000' |
while read mod_src mod_dst sha1_src sha1_dst status name
do
@@ -592,7 +592,7 @@ cmd_summary() {
test -z "$modules" && return
- git $diff_cmd $cached --raw $head -- $modules |
+ git $diff_cmd $cached --ignore-submodules=dirty --raw $head -- $modules |
sane_egrep '^:([0-7]* )?160000' |
cut -c2- |
while read mod_src mod_dst sha1_src sha1_dst status name
@@ -758,7 +758,7 @@ cmd_status()
continue;
fi
set_name_rev "$path" "$sha1"
- if git diff-files --quiet -- "$path"
+ if git diff-files --ignore-submodules=dirty --quiet -- "$path"
then
say " $sha1 $displaypath$revname"
else