From: Junio C Hamano Date: Sun, 20 Apr 2008 04:11:29 +0000 (-0700) Subject: Merge branch 'py/submodule' X-Git-Tag: v1.5.6-rc0~137 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/3642617ee7359eed5e108fea48981841591142bf?ds=inline;hp=-c Merge branch 'py/submodule' * py/submodule: builtin-status: Add tests for submodule summary builtin-status: submodule summary support git-submodule summary: --for-status option --- 3642617ee7359eed5e108fea48981841591142bf diff --combined git-submodule.sh index a745e42bf7,3249042028..ce0f00c8a4 --- a/git-submodule.sh +++ b/git-submodule.sh @@@ -327,8 -327,7 +327,8 @@@ set_name_rev () cd "$1" && { git describe "$2" 2>/dev/null || git describe --tags "$2" 2>/dev/null || - git describe --contains --tags --always "$2" + git describe --contains "$2" 2>/dev/null || + git describe --all --always "$2" } ) ) test -z "$revname" || revname=" ($revname)" @@@ -343,6 -342,7 +343,7 @@@ # cmd_summary() { summary_limit=-1 + for_status= # parse $args after "submodule ... summary". while test $# -ne 0 @@@ -351,6 -351,9 +352,9 @@@ --cached) cached="$1" ;; + --for-status) + for_status="$1" + ;; -n|--summary-limit) if summary_limit=$(($2 + 0)) 2>/dev/null && test "$summary_limit" = "$2" then @@@ -398,7 -401,8 +402,8 @@@ done ) - test -n "$modules" && + test -z "$modules" && return + git diff-index $cached --raw $head -- $modules | grep -e '^:160000' -e '^:[0-7]* 160000' | cut -c2- | @@@ -500,7 -504,14 +505,14 @@@ echo fi echo - done + done | + if test -n "$for_status"; then + echo "# Modified submodules:" + echo "#" + sed -e 's|^|# |' -e 's|^# $|#|' + else + cat + fi } # # List all submodules, prefixed with: