@matheusbsbs / matheus-bagliano / commits / 759ad19e77
Fork 0

submodule: fix some non-portable grep invocations

Not all greps support "-e", but in this case we can easily convert it to a single extended regex. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jeff King committed Oct 22, 2008 at 15:22 UTC 759ad19e772a79a2a5ae6b7377d57eb21d29e6a0
1 file changed +2 -2
git-submodule.sh
+2 -2
@@ -424,7 +424,7 @@ cmd_summary() {
424 cd_to_toplevel
425 # Get modified modules cared by user
426 modules=$(git diff-index $cached --raw $head -- "$@" |
427 - grep -e '^:160000' -e '^:[0-7]* 160000' |
427 + egrep '^:([0-7]* )?160000' |
428 while read mod_src mod_dst sha1_src sha1_dst status name
429 do
430 # Always show modules deleted or type-changed (blob<->module)
@@ -438,7 +438,7 @@ cmd_summary() {
438 test -z "$modules" && return
439
440 git diff-index $cached --raw $head -- $modules |
441 - grep -e '^:160000' -e '^:[0-7]* 160000' |
441 + egrep '^:([0-7]* )?160000' |
442 cut -c2- |
443 while read mod_src mod_dst sha1_src sha1_dst status name
444 do