Skip to content

Commit

Permalink
git submodule: ignore dirty submodules for summary and status
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jens Lehmann authored and Junio C Hamano committed Jun 25, 2010
1 parent 6ed7dda commit 1807650
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions git-submodule.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 1807650

Please sign in to comment.