X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=git-submodule.sh;h=220d94ec0c53c9d6c4535d1e50f5d1cb9dc99689;hb=496917b721adae11e596cd44b13cb8a49c388de7;hp=65178ae8e32bb20c65c42eb9668fb0ffec749007;hpb=9800c0df412869c7949935b61581b9361fc49bd1;p=git.git diff --git a/git-submodule.sh b/git-submodule.sh index 65178ae8e..6cc2d334c 100755 --- a/git-submodule.sh +++ b/git-submodule.sh @@ -59,7 +59,7 @@ resolve_relative_url () # module_list() { - git ls-files --stage -- "$@" | grep '^160000 ' + git ls-files --error-unmatch --stage -- "$@" | grep '^160000 ' } # @@ -323,7 +323,7 @@ cmd_update() # Only mention uninitialized submodules when its # path have been specified test "$#" != "0" && - say "Submodule path '$path' not initialized" + say "Submodule path '$path' not initialized" && say "Maybe you want to use 'update --init'?" continue fi @@ -413,7 +413,7 @@ cmd_summary() { test $summary_limit = 0 && return - if rev=$(git rev-parse --verify "$1^0" 2>/dev/null) + if rev=$(git rev-parse -q --verify "$1^0") then head=$rev shift @@ -424,7 +424,7 @@ cmd_summary() { cd_to_toplevel # Get modified modules cared by user modules=$(git diff-index $cached --raw $head -- "$@" | - grep -e '^:160000' -e '^:[0-7]* 160000' | + egrep '^:([0-7]* )?160000' | while read mod_src mod_dst sha1_src sha1_dst status name do # Always show modules deleted or type-changed (blob<->module) @@ -438,7 +438,7 @@ cmd_summary() { test -z "$modules" && return git diff-index $cached --raw $head -- $modules | - grep -e '^:160000' -e '^:[0-7]* 160000' | + egrep '^:([0-7]* )?160000' | cut -c2- | while read mod_src mod_dst sha1_src sha1_dst status name do @@ -464,11 +464,11 @@ cmd_summary() { missing_dst= test $mod_src = 160000 && - ! GIT_DIR="$name/.git" git-rev-parse --verify $sha1_src^0 >/dev/null 2>&1 && + ! GIT_DIR="$name/.git" git-rev-parse -q --verify $sha1_src^0 >/dev/null && missing_src=t test $mod_dst = 160000 && - ! GIT_DIR="$name/.git" git-rev-parse --verify $sha1_dst^0 >/dev/null 2>&1 && + ! GIT_DIR="$name/.git" git-rev-parse -q --verify $sha1_dst^0 >/dev/null && missing_dst=t total_commits=