Re: What's cooking in git.git (Dec 2016, #02; Mon, 12)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Junio,

On Mon, 12 Dec 2016, Junio C Hamano wrote:

> * bw/grep-recurse-submodules (2016-11-22) 6 commits
>  - grep: search history of moved submodules
>  - grep: enable recurse-submodules to work on <tree> objects
>  - grep: optionally recurse into submodules
>  - grep: add submodules as a grep source type
>  - submodules: load gitmodules file from commit sha1
>  - submodules: add helper functions to determine presence of submodules
> 
>  "git grep" learns to optionally recurse into submodules
> 
>  Has anybody else seen t7814 being flakey with this series?

It is not flakey for me, it fails consistently on Windows. This is the
output with -i -v -x (sorry, I won't have time this week to do anything
about it, but maybe it helps identify the root cause):

-- snipsnap --
Initialized empty Git repository in C:/git-sdk-64/usr/src/git/wip3/t/trash
directory.t7814-grep-recurse-submodules/.git/
expecting success: 
	echo "foobar" >a &&
	mkdir b &&
	echo "bar" >b/b &&
	git add a b &&
	git commit -m "add a and b" &&
	git init submodule &&
	echo "foobar" >submodule/a &&
	git -C submodule add a &&
	git -C submodule commit -m "add a" &&
	git submodule add ./submodule &&
	git commit -m "added submodule"

++ echo foobar
++ mkdir b
++ echo bar
++ git add a b
++ git commit -m 'add a and b'
[master (root-commit) 6a17548] add a and b
 Author: A U Thor <author@xxxxxxxxxxx>
 2 files changed, 2 insertions(+)
 create mode 100644 a
 create mode 100644 b/b
++ git init submodule
Initialized empty Git repository in C:/git-sdk-64/usr/src/git/wip3/t/trash
directory.t7814-grep-recurse-submodules/submodule/.git/
++ echo foobar
++ git -C submodule add a
++ git -C submodule commit -m 'add a'
[master (root-commit) 081a998] add a
 Author: A U Thor <author@xxxxxxxxxxx>
 1 file changed, 1 insertion(+)
 create mode 100644 a
++ git submodule add ./submodule
Adding existing repo at 'submodule' to the index
++ git commit -m 'added submodule'
[master 0c0fdd0] added submodule
 Author: A U Thor <author@xxxxxxxxxxx>
 2 files changed, 4 insertions(+)
 create mode 100644 .gitmodules
 create mode 160000 submodule
+ test_eval_ret_=0
+ want_trace
+ test t = t
+ test t = t
+ set +x
ok 1 - setup directory structure and submodule

expecting success: 
	cat >expect <<-\EOF &&
	a:foobar
	b/b:bar
	submodule/a:foobar
	EOF

	git grep -e "bar" --recurse-submodules >actual &&
	test_cmp expect actual

++ cat
++ git grep -e bar --recurse-submodules
++ test_cmp expect actual
++ mingw_test_cmp expect actual
++ local test_cmp_a= test_cmp_b=
++ local stdin_for_diff=
++ test -s expect
++ test -s actual
++ mingw_read_file_strip_cr_ test_cmp_a
++ local line
++ :
++ IFS=$'\r'
++ read -r -d '
' line
++ line='a:foobar
'
++ eval 'test_cmp_a=$test_cmp_a$line'
+++ test_cmp_a='a:foobar
'
++ :
++ IFS=$'\r'
++ read -r -d '
' line
++ line='b/b:bar
'
++ eval 'test_cmp_a=$test_cmp_a$line'
+++ test_cmp_a='a:foobar
b/b:bar
'
++ :
++ IFS=$'\r'
++ read -r -d '
' line
++ line='submodule/a:foobar
'
++ eval 'test_cmp_a=$test_cmp_a$line'
+++ test_cmp_a='a:foobar
b/b:bar
submodule/a:foobar
'
++ :
++ IFS=$'\r'
++ read -r -d '
' line
++ test -z ''
++ break
++ mingw_read_file_strip_cr_ test_cmp_b
++ local line
++ :
++ IFS=$'\r'
++ read -r -d '
' line
++ line='a:foobar
'
++ eval 'test_cmp_b=$test_cmp_b$line'
+++ test_cmp_b='a:foobar
'
++ :
++ IFS=$'\r'
++ read -r -d '
' line
++ line='b/b:bar
'
++ eval 'test_cmp_b=$test_cmp_b$line'
+++ test_cmp_b='a:foobar
b/b:bar
'
++ :
++ IFS=$'\r'
++ read -r -d '
' line
++ line='submodule/a:foobar
'
++ eval 'test_cmp_b=$test_cmp_b$line'
+++ test_cmp_b='a:foobar
b/b:bar
submodule/a:foobar
'
++ :
++ IFS=$'\r'
++ read -r -d '
' line
++ test -z ''
++ break
++ test -n 'a:foobar
b/b:bar
submodule/a:foobar
'
++ test -n 'a:foobar
b/b:bar
submodule/a:foobar
'
++ test 'a:foobar
b/b:bar
submodule/a:foobar
' = 'a:foobar
b/b:bar
submodule/a:foobar
'
+ test_eval_ret_=0
+ want_trace
+ test t = t
+ test t = t
+ set +x
ok 2 - grep correctly finds patterns in a submodule

expecting success: 
	cat >expect <<-\EOF &&
	submodule/a:foobar
	EOF

	git grep -e. --recurse-submodules -- submodule >actual &&
	test_cmp expect actual

++ cat
++ git grep -e. --recurse-submodules -- submodule
++ test_cmp expect actual
++ mingw_test_cmp expect actual
++ local test_cmp_a= test_cmp_b=
++ local stdin_for_diff=
++ test -s expect
++ test -s actual
++ mingw_read_file_strip_cr_ test_cmp_a
++ local line
++ :
++ IFS=$'\r'
++ read -r -d '
' line
++ line='submodule/a:foobar
'
++ eval 'test_cmp_a=$test_cmp_a$line'
+++ test_cmp_a='submodule/a:foobar
'
++ :
++ IFS=$'\r'
++ read -r -d '
' line
++ test -z ''
++ break
++ mingw_read_file_strip_cr_ test_cmp_b
++ local line
++ :
++ IFS=$'\r'
++ read -r -d '
' line
++ line='submodule/a:foobar
'
++ eval 'test_cmp_b=$test_cmp_b$line'
+++ test_cmp_b='submodule/a:foobar
'
++ :
++ IFS=$'\r'
++ read -r -d '
' line
++ test -z ''
++ break
++ test -n 'submodule/a:foobar
'
++ test -n 'submodule/a:foobar
'
++ test 'submodule/a:foobar
' = 'submodule/a:foobar
'
+ test_eval_ret_=0
+ want_trace
+ test t = t
+ test t = t
+ set +x
ok 3 - grep and basic pathspecs

expecting success: 
	git init submodule/sub &&
	echo "foobar" >submodule/sub/a &&
	git -C submodule/sub add a &&
	git -C submodule/sub commit -m "add a" &&
	git -C submodule submodule add ./sub &&
	git -C submodule add sub &&
	git -C submodule commit -m "added sub" &&
	git add submodule &&
	git commit -m "updated submodule" &&

	cat >expect <<-\EOF &&
	a:foobar
	b/b:bar
	submodule/a:foobar
	submodule/sub/a:foobar
	EOF

	git grep -e "bar" --recurse-submodules >actual &&
	test_cmp expect actual

++ git init submodule/sub
Initialized empty Git repository in C:/git-sdk-64/usr/src/git/wip3/t/trash
directory.t7814-grep-recurse-submodules/submodule/sub/.git/
++ echo foobar
++ git -C submodule/sub add a
++ git -C submodule/sub commit -m 'add a'
[master (root-commit) b95b263] add a
 Author: A U Thor <author@xxxxxxxxxxx>
 1 file changed, 1 insertion(+)
 create mode 100644 a
++ git -C submodule submodule add ./sub
Adding existing repo at 'sub' to the index
++ git -C submodule add sub
++ git -C submodule commit -m 'added sub'
[master 190608e] added sub
 Author: A U Thor <author@xxxxxxxxxxx>
 2 files changed, 4 insertions(+)
 create mode 100644 .gitmodules
 create mode 160000 sub
++ git add submodule
++ git commit -m 'updated submodule'
[master 5198849] updated submodule
 Author: A U Thor <author@xxxxxxxxxxx>
 1 file changed, 1 insertion(+), 1 deletion(-)
++ cat
++ git grep -e bar --recurse-submodules
++ test_cmp expect actual
++ mingw_test_cmp expect actual
++ local test_cmp_a= test_cmp_b=
++ local stdin_for_diff=
++ test -s expect
++ test -s actual
++ mingw_read_file_strip_cr_ test_cmp_a
++ local line
++ :
++ IFS=$'\r'
++ read -r -d '
' line
++ line='a:foobar
'
++ eval 'test_cmp_a=$test_cmp_a$line'
+++ test_cmp_a='a:foobar
'
++ :
++ IFS=$'\r'
++ read -r -d '
' line
++ line='b/b:bar
'
++ eval 'test_cmp_a=$test_cmp_a$line'
+++ test_cmp_a='a:foobar
b/b:bar
'
++ :
++ IFS=$'\r'
++ read -r -d '
' line
++ line='submodule/a:foobar
'
++ eval 'test_cmp_a=$test_cmp_a$line'
+++ test_cmp_a='a:foobar
b/b:bar
submodule/a:foobar
'
++ :
++ IFS=$'\r'
++ read -r -d '
' line
++ line='submodule/sub/a:foobar
'
++ eval 'test_cmp_a=$test_cmp_a$line'
+++ test_cmp_a='a:foobar
b/b:bar
submodule/a:foobar
submodule/sub/a:foobar
'
++ :
++ IFS=$'\r'
++ read -r -d '
' line
++ test -z ''
++ break
++ mingw_read_file_strip_cr_ test_cmp_b
++ local line
++ :
++ IFS=$'\r'
++ read -r -d '
' line
++ line='a:foobar
'
++ eval 'test_cmp_b=$test_cmp_b$line'
+++ test_cmp_b='a:foobar
'
++ :
++ IFS=$'\r'
++ read -r -d '
' line
++ line='b/b:bar
'
++ eval 'test_cmp_b=$test_cmp_b$line'
+++ test_cmp_b='a:foobar
b/b:bar
'
++ :
++ IFS=$'\r'
++ read -r -d '
' line
++ line='submodule/a:foobar
'
++ eval 'test_cmp_b=$test_cmp_b$line'
+++ test_cmp_b='a:foobar
b/b:bar
submodule/a:foobar
'
++ :
++ IFS=$'\r'
++ read -r -d '
' line
++ line='submodule/sub/a:foobar
'
++ eval 'test_cmp_b=$test_cmp_b$line'
+++ test_cmp_b='a:foobar
b/b:bar
submodule/a:foobar
submodule/sub/a:foobar
'
++ :
++ IFS=$'\r'
++ read -r -d '
' line
++ test -z ''
++ break
++ test -n 'a:foobar
b/b:bar
submodule/a:foobar
submodule/sub/a:foobar
'
++ test -n 'a:foobar
b/b:bar
submodule/a:foobar
submodule/sub/a:foobar
'
++ test 'a:foobar
b/b:bar
submodule/a:foobar
submodule/sub/a:foobar
' = 'a:foobar
b/b:bar
submodule/a:foobar
submodule/sub/a:foobar
'
+ test_eval_ret_=0
+ want_trace
+ test t = t
+ test t = t
+ set +x
ok 4 - grep and nested submodules

expecting success: 
	cat >expect <<-\EOF &&
	a:foobar
	submodule/a:foobar
	submodule/sub/a:foobar
	EOF

	git grep -e "bar" --and -e "foo" --recurse-submodules >actual &&
	test_cmp expect actual

++ cat
++ git grep -e bar --and -e foo --recurse-submodules
++ test_cmp expect actual
++ mingw_test_cmp expect actual
++ local test_cmp_a= test_cmp_b=
++ local stdin_for_diff=
++ test -s expect
++ test -s actual
++ mingw_read_file_strip_cr_ test_cmp_a
++ local line
++ :
++ IFS=$'\r'
++ read -r -d '
' line
++ line='a:foobar
'
++ eval 'test_cmp_a=$test_cmp_a$line'
+++ test_cmp_a='a:foobar
'
++ :
++ IFS=$'\r'
++ read -r -d '
' line
++ line='submodule/a:foobar
'
++ eval 'test_cmp_a=$test_cmp_a$line'
+++ test_cmp_a='a:foobar
submodule/a:foobar
'
++ :
++ IFS=$'\r'
++ read -r -d '
' line
++ line='submodule/sub/a:foobar
'
++ eval 'test_cmp_a=$test_cmp_a$line'
+++ test_cmp_a='a:foobar
submodule/a:foobar
submodule/sub/a:foobar
'
++ :
++ IFS=$'\r'
++ read -r -d '
' line
++ test -z ''
++ break
++ mingw_read_file_strip_cr_ test_cmp_b
++ local line
++ :
++ IFS=$'\r'
++ read -r -d '
' line
++ line='a:foobar
'
++ eval 'test_cmp_b=$test_cmp_b$line'
+++ test_cmp_b='a:foobar
'
++ :
++ IFS=$'\r'
++ read -r -d '
' line
++ line='submodule/a:foobar
'
++ eval 'test_cmp_b=$test_cmp_b$line'
+++ test_cmp_b='a:foobar
submodule/a:foobar
'
++ :
++ IFS=$'\r'
++ read -r -d '
' line
++ line='submodule/sub/a:foobar
'
++ eval 'test_cmp_b=$test_cmp_b$line'
+++ test_cmp_b='a:foobar
submodule/a:foobar
submodule/sub/a:foobar
'
++ :
++ IFS=$'\r'
++ read -r -d '
' line
++ test -z ''
++ break
++ test -n 'a:foobar
submodule/a:foobar
submodule/sub/a:foobar
'
++ test -n 'a:foobar
submodule/a:foobar
submodule/sub/a:foobar
'
++ test 'a:foobar
submodule/a:foobar
submodule/sub/a:foobar
' = 'a:foobar
submodule/a:foobar
submodule/sub/a:foobar
'
+ test_eval_ret_=0
+ want_trace
+ test t = t
+ test t = t
+ set +x
ok 5 - grep and multiple patterns

expecting success: 
	cat >expect <<-\EOF &&
	b/b:bar
	EOF

	git grep -e "bar" --and --not -e "foo" --recurse-submodules
>actual &&
	test_cmp expect actual

++ cat
++ git grep -e bar --and --not -e foo --recurse-submodules
++ test_cmp expect actual
++ mingw_test_cmp expect actual
++ local test_cmp_a= test_cmp_b=
++ local stdin_for_diff=
++ test -s expect
++ test -s actual
++ mingw_read_file_strip_cr_ test_cmp_a
++ local line
++ :
++ IFS=$'\r'
++ read -r -d '
' line
++ line='b/b:bar
'
++ eval 'test_cmp_a=$test_cmp_a$line'
+++ test_cmp_a='b/b:bar
'
++ :
++ IFS=$'\r'
++ read -r -d '
' line
++ test -z ''
++ break
++ mingw_read_file_strip_cr_ test_cmp_b
++ local line
++ :
++ IFS=$'\r'
++ read -r -d '
' line
++ line='b/b:bar
'
++ eval 'test_cmp_b=$test_cmp_b$line'
+++ test_cmp_b='b/b:bar
'
++ :
++ IFS=$'\r'
++ read -r -d '
' line
++ test -z ''
++ break
++ test -n 'b/b:bar
'
++ test -n 'b/b:bar
'
++ test 'b/b:bar
' = 'b/b:bar
'
+ test_eval_ret_=0
+ want_trace
+ test t = t
+ test t = t
+ set +x
ok 6 - grep and multiple patterns

expecting success: 
	cat >expect <<-\EOF &&
	HEAD:a:foobar
	HEAD:b/b:bar
	HEAD:submodule/a:foobar
	HEAD:submodule/sub/a:foobar
	EOF

	git grep -e "bar" --recurse-submodules HEAD >actual &&
	test_cmp expect actual

++ cat
++ git grep -e bar --recurse-submodules HEAD
++ test_cmp expect actual
++ mingw_test_cmp expect actual
++ local test_cmp_a= test_cmp_b=
++ local stdin_for_diff=
++ test -s expect
++ test -s actual
++ mingw_read_file_strip_cr_ test_cmp_a
++ local line
++ :
++ IFS=$'\r'
++ read -r -d '
' line
++ line='HEAD:a:foobar
'
++ eval 'test_cmp_a=$test_cmp_a$line'
+++ test_cmp_a='HEAD:a:foobar
'
++ :
++ IFS=$'\r'
++ read -r -d '
' line
++ line='HEAD:b/b:bar
'
++ eval 'test_cmp_a=$test_cmp_a$line'
+++ test_cmp_a='HEAD:a:foobar
HEAD:b/b:bar
'
++ :
++ IFS=$'\r'
++ read -r -d '
' line
++ line='HEAD:submodule/a:foobar
'
++ eval 'test_cmp_a=$test_cmp_a$line'
+++ test_cmp_a='HEAD:a:foobar
HEAD:b/b:bar
HEAD:submodule/a:foobar
'
++ :
++ IFS=$'\r'
++ read -r -d '
' line
++ line='HEAD:submodule/sub/a:foobar
'
++ eval 'test_cmp_a=$test_cmp_a$line'
+++ test_cmp_a='HEAD:a:foobar
HEAD:b/b:bar
HEAD:submodule/a:foobar
HEAD:submodule/sub/a:foobar
'
++ :
++ IFS=$'\r'
++ read -r -d '
' line
++ test -z ''
++ break
++ mingw_read_file_strip_cr_ test_cmp_b
++ local line
++ :
++ IFS=$'\r'
++ read -r -d '
' line
++ line='HEAD:a:foobar
'
++ eval 'test_cmp_b=$test_cmp_b$line'
+++ test_cmp_b='HEAD:a:foobar
'
++ :
++ IFS=$'\r'
++ read -r -d '
' line
++ line='HEAD:b/b:bar
'
++ eval 'test_cmp_b=$test_cmp_b$line'
+++ test_cmp_b='HEAD:a:foobar
HEAD:b/b:bar
'
++ :
++ IFS=$'\r'
++ read -r -d '
' line
++ line='HEAD:submodule/a:foobar
'
++ eval 'test_cmp_b=$test_cmp_b$line'
+++ test_cmp_b='HEAD:a:foobar
HEAD:b/b:bar
HEAD:submodule/a:foobar
'
++ :
++ IFS=$'\r'
++ read -r -d '
' line
++ line='HEAD:submodule/sub/a:foobar
'
++ eval 'test_cmp_b=$test_cmp_b$line'
+++ test_cmp_b='HEAD:a:foobar
HEAD:b/b:bar
HEAD:submodule/a:foobar
HEAD:submodule/sub/a:foobar
'
++ :
++ IFS=$'\r'
++ read -r -d '
' line
++ test -z ''
++ break
++ test -n 'HEAD:a:foobar
HEAD:b/b:bar
HEAD:submodule/a:foobar
HEAD:submodule/sub/a:foobar
'
++ test -n 'HEAD:a:foobar
HEAD:b/b:bar
HEAD:submodule/a:foobar
HEAD:submodule/sub/a:foobar
'
++ test 'HEAD:a:foobar
HEAD:b/b:bar
HEAD:submodule/a:foobar
HEAD:submodule/sub/a:foobar
' = 'HEAD:a:foobar
HEAD:b/b:bar
HEAD:submodule/a:foobar
HEAD:submodule/sub/a:foobar
'
+ test_eval_ret_=0
+ want_trace
+ test t = t
+ test t = t
+ set +x
ok 7 - basic grep tree

expecting success: 
	cat >expect <<-\EOF &&
	HEAD^:a:foobar
	HEAD^:b/b:bar
	HEAD^:submodule/a:foobar
	EOF

	git grep -e "bar" --recurse-submodules HEAD^ >actual &&
	test_cmp expect actual

++ cat
++ git grep -e bar --recurse-submodules 'HEAD^'
++ test_cmp expect actual
++ mingw_test_cmp expect actual
++ local test_cmp_a= test_cmp_b=
++ local stdin_for_diff=
++ test -s expect
++ test -s actual
++ mingw_read_file_strip_cr_ test_cmp_a
++ local line
++ :
++ IFS=$'\r'
++ read -r -d '
' line
++ line='HEAD^:a:foobar
'
++ eval 'test_cmp_a=$test_cmp_a$line'
+++ test_cmp_a='HEAD^:a:foobar
'
++ :
++ IFS=$'\r'
++ read -r -d '
' line
++ line='HEAD^:b/b:bar
'
++ eval 'test_cmp_a=$test_cmp_a$line'
+++ test_cmp_a='HEAD^:a:foobar
HEAD^:b/b:bar
'
++ :
++ IFS=$'\r'
++ read -r -d '
' line
++ line='HEAD^:submodule/a:foobar
'
++ eval 'test_cmp_a=$test_cmp_a$line'
+++ test_cmp_a='HEAD^:a:foobar
HEAD^:b/b:bar
HEAD^:submodule/a:foobar
'
++ :
++ IFS=$'\r'
++ read -r -d '
' line
++ test -z ''
++ break
++ mingw_read_file_strip_cr_ test_cmp_b
++ local line
++ :
++ IFS=$'\r'
++ read -r -d '
' line
++ line='HEAD^:a:foobar
'
++ eval 'test_cmp_b=$test_cmp_b$line'
+++ test_cmp_b='HEAD^:a:foobar
'
++ :
++ IFS=$'\r'
++ read -r -d '
' line
++ line='HEAD^:b/b:bar
'
++ eval 'test_cmp_b=$test_cmp_b$line'
+++ test_cmp_b='HEAD^:a:foobar
HEAD^:b/b:bar
'
++ :
++ IFS=$'\r'
++ read -r -d '
' line
++ line='HEAD^:submodule/a:foobar
'
++ eval 'test_cmp_b=$test_cmp_b$line'
+++ test_cmp_b='HEAD^:a:foobar
HEAD^:b/b:bar
HEAD^:submodule/a:foobar
'
++ :
++ IFS=$'\r'
++ read -r -d '
' line
++ test -z ''
++ break
++ test -n 'HEAD^:a:foobar
HEAD^:b/b:bar
HEAD^:submodule/a:foobar
'
++ test -n 'HEAD^:a:foobar
HEAD^:b/b:bar
HEAD^:submodule/a:foobar
'
++ test 'HEAD^:a:foobar
HEAD^:b/b:bar
HEAD^:submodule/a:foobar
' = 'HEAD^:a:foobar
HEAD^:b/b:bar
HEAD^:submodule/a:foobar
'
+ test_eval_ret_=0
+ want_trace
+ test t = t
+ test t = t
+ set +x
ok 8 - grep tree HEAD^

expecting success: 
	cat >expect <<-\EOF &&
	HEAD^^:a:foobar
	HEAD^^:b/b:bar
	EOF

	git grep -e "bar" --recurse-submodules HEAD^^ >actual &&
	test_cmp expect actual

++ cat
++ git grep -e bar --recurse-submodules 'HEAD^^'
++ test_cmp expect actual
++ mingw_test_cmp expect actual
++ local test_cmp_a= test_cmp_b=
++ local stdin_for_diff=
++ test -s expect
++ test -s actual
++ mingw_read_file_strip_cr_ test_cmp_a
++ local line
++ :
++ IFS=$'\r'
++ read -r -d '
' line
++ line='HEAD^^:a:foobar
'
++ eval 'test_cmp_a=$test_cmp_a$line'
+++ test_cmp_a='HEAD^^:a:foobar
'
++ :
++ IFS=$'\r'
++ read -r -d '
' line
++ line='HEAD^^:b/b:bar
'
++ eval 'test_cmp_a=$test_cmp_a$line'
+++ test_cmp_a='HEAD^^:a:foobar
HEAD^^:b/b:bar
'
++ :
++ IFS=$'\r'
++ read -r -d '
' line
++ test -z ''
++ break
++ mingw_read_file_strip_cr_ test_cmp_b
++ local line
++ :
++ IFS=$'\r'
++ read -r -d '
' line
++ line='HEAD^^:a:foobar
'
++ eval 'test_cmp_b=$test_cmp_b$line'
+++ test_cmp_b='HEAD^^:a:foobar
'
++ :
++ IFS=$'\r'
++ read -r -d '
' line
++ line='HEAD^^:b/b:bar
'
++ eval 'test_cmp_b=$test_cmp_b$line'
+++ test_cmp_b='HEAD^^:a:foobar
HEAD^^:b/b:bar
'
++ :
++ IFS=$'\r'
++ read -r -d '
' line
++ test -z ''
++ break
++ test -n 'HEAD^^:a:foobar
HEAD^^:b/b:bar
'
++ test -n 'HEAD^^:a:foobar
HEAD^^:b/b:bar
'
++ test 'HEAD^^:a:foobar
HEAD^^:b/b:bar
' = 'HEAD^^:a:foobar
HEAD^^:b/b:bar
'
+ test_eval_ret_=0
+ want_trace
+ test t = t
+ test t = t
+ set +x
ok 9 - grep tree HEAD^^

expecting success: 
	cat >expect <<-\EOF &&
	HEAD:submodule/a:foobar
	HEAD:submodule/sub/a:foobar
	EOF

	git grep -e "bar" --recurse-submodules HEAD -- submodule >actual
&&
	test_cmp expect actual

++ cat
++ git grep -e bar --recurse-submodules HEAD -- submodule
++ test_cmp expect actual
++ mingw_test_cmp expect actual
++ local test_cmp_a= test_cmp_b=
++ local stdin_for_diff=
++ test -s expect
++ test -s actual
++ mingw_read_file_strip_cr_ test_cmp_a
++ local line
++ :
++ IFS=$'\r'
++ read -r -d '
' line
++ line='HEAD:submodule/a:foobar
'
++ eval 'test_cmp_a=$test_cmp_a$line'
+++ test_cmp_a='HEAD:submodule/a:foobar
'
++ :
++ IFS=$'\r'
++ read -r -d '
' line
++ line='HEAD:submodule/sub/a:foobar
'
++ eval 'test_cmp_a=$test_cmp_a$line'
+++ test_cmp_a='HEAD:submodule/a:foobar
HEAD:submodule/sub/a:foobar
'
++ :
++ IFS=$'\r'
++ read -r -d '
' line
++ test -z ''
++ break
++ mingw_read_file_strip_cr_ test_cmp_b
++ local line
++ :
++ IFS=$'\r'
++ read -r -d '
' line
++ line='HEAD:submodule/a:foobar
'
++ eval 'test_cmp_b=$test_cmp_b$line'
+++ test_cmp_b='HEAD:submodule/a:foobar
'
++ :
++ IFS=$'\r'
++ read -r -d '
' line
++ line='HEAD:submodule/sub/a:foobar
'
++ eval 'test_cmp_b=$test_cmp_b$line'
+++ test_cmp_b='HEAD:submodule/a:foobar
HEAD:submodule/sub/a:foobar
'
++ :
++ IFS=$'\r'
++ read -r -d '
' line
++ test -z ''
++ break
++ test -n 'HEAD:submodule/a:foobar
HEAD:submodule/sub/a:foobar
'
++ test -n 'HEAD:submodule/a:foobar
HEAD:submodule/sub/a:foobar
'
++ test 'HEAD:submodule/a:foobar
HEAD:submodule/sub/a:foobar
' = 'HEAD:submodule/a:foobar
HEAD:submodule/sub/a:foobar
'
+ test_eval_ret_=0
+ want_trace
+ test t = t
+ test t = t
+ set +x
ok 10 - grep tree and pathspecs

expecting success: 
	cat >expect <<-\EOF &&
	HEAD:submodule/a:foobar
	HEAD:submodule/sub/a:foobar
	EOF

	git grep -e "bar" --recurse-submodules HEAD -- "submodule*a"
>actual &&
	test_cmp expect actual

++ cat
++ git grep -e bar --recurse-submodules HEAD -- 'submodule*a'
++ test_cmp expect actual
++ mingw_test_cmp expect actual
++ local test_cmp_a= test_cmp_b=
++ local stdin_for_diff=
++ test -s expect
++ test -s actual
++ mingw_read_file_strip_cr_ test_cmp_a
++ local line
++ :
++ IFS=$'\r'
++ read -r -d '
' line
++ line='HEAD:submodule/a:foobar
'
++ eval 'test_cmp_a=$test_cmp_a$line'
+++ test_cmp_a='HEAD:submodule/a:foobar
'
++ :
++ IFS=$'\r'
++ read -r -d '
' line
++ line='HEAD:submodule/sub/a:foobar
'
++ eval 'test_cmp_a=$test_cmp_a$line'
+++ test_cmp_a='HEAD:submodule/a:foobar
HEAD:submodule/sub/a:foobar
'
++ :
++ IFS=$'\r'
++ read -r -d '
' line
++ test -z ''
++ break
++ mingw_read_file_strip_cr_ test_cmp_b
++ local line
++ :
++ IFS=$'\r'
++ read -r -d '
' line
++ line='HEAD:submodule/a:foobar
'
++ eval 'test_cmp_b=$test_cmp_b$line'
+++ test_cmp_b='HEAD:submodule/a:foobar
'
++ :
++ IFS=$'\r'
++ read -r -d '
' line
++ line='HEAD:submodule/sub/a:foobar
'
++ eval 'test_cmp_b=$test_cmp_b$line'
+++ test_cmp_b='HEAD:submodule/a:foobar
HEAD:submodule/sub/a:foobar
'
++ :
++ IFS=$'\r'
++ read -r -d '
' line
++ test -z ''
++ break
++ test -n 'HEAD:submodule/a:foobar
HEAD:submodule/sub/a:foobar
'
++ test -n 'HEAD:submodule/a:foobar
HEAD:submodule/sub/a:foobar
'
++ test 'HEAD:submodule/a:foobar
HEAD:submodule/sub/a:foobar
' = 'HEAD:submodule/a:foobar
HEAD:submodule/sub/a:foobar
'
+ test_eval_ret_=0
+ want_trace
+ test t = t
+ test t = t
+ set +x
ok 11 - grep tree and pathspecs

expecting success: 
	cat >expect <<-\EOF &&
	HEAD:submodule/a:foobar
	EOF

	git grep -e "bar" --recurse-submodules HEAD -- "submodul?/a"
>actual &&
	test_cmp expect actual

++ cat
++ git grep -e bar --recurse-submodules HEAD -- 'submodul?/a'
++ test_cmp expect actual
++ mingw_test_cmp expect actual
++ local test_cmp_a= test_cmp_b=
++ local stdin_for_diff=
++ test -s expect
++ test -s actual
++ mingw_read_file_strip_cr_ test_cmp_a
++ local line
++ :
++ IFS=$'\r'
++ read -r -d '
' line
++ line='HEAD:submodule/a:foobar
'
++ eval 'test_cmp_a=$test_cmp_a$line'
+++ test_cmp_a='HEAD:submodule/a:foobar
'
++ :
++ IFS=$'\r'
++ read -r -d '
' line
++ test -z ''
++ break
++ mingw_read_file_strip_cr_ test_cmp_b
++ local line
++ :
++ IFS=$'\r'
++ read -r -d '
' line
++ line='HEAD:submodule/a:foobar
'
++ eval 'test_cmp_b=$test_cmp_b$line'
+++ test_cmp_b='HEAD:submodule/a:foobar
'
++ :
++ IFS=$'\r'
++ read -r -d '
' line
++ test -z ''
++ break
++ test -n 'HEAD:submodule/a:foobar
'
++ test -n 'HEAD:submodule/a:foobar
'
++ test 'HEAD:submodule/a:foobar
' = 'HEAD:submodule/a:foobar
'
+ test_eval_ret_=0
+ want_trace
+ test t = t
+ test t = t
+ set +x
ok 12 - grep tree and more pathspecs

expecting success: 
	cat >expect <<-\EOF &&
	HEAD:submodule/sub/a:foobar
	EOF

	git grep -e "bar" --recurse-submodules HEAD -- "submodul*/sub/a"
>actual &&
	test_cmp expect actual

++ cat
++ git grep -e bar --recurse-submodules HEAD -- 'submodul*/sub/a'
++ test_cmp expect actual
++ mingw_test_cmp expect actual
++ local test_cmp_a= test_cmp_b=
++ local stdin_for_diff=
++ test -s expect
++ test -s actual
++ mingw_read_file_strip_cr_ test_cmp_a
++ local line
++ :
++ IFS=$'\r'
++ read -r -d '
' line
++ line='HEAD:submodule/sub/a:foobar
'
++ eval 'test_cmp_a=$test_cmp_a$line'
+++ test_cmp_a='HEAD:submodule/sub/a:foobar
'
++ :
++ IFS=$'\r'
++ read -r -d '
' line
++ test -z ''
++ break
++ mingw_read_file_strip_cr_ test_cmp_b
++ local line
++ :
++ IFS=$'\r'
++ read -r -d '
' line
++ line='HEAD:submodule/sub/a:foobar
'
++ eval 'test_cmp_b=$test_cmp_b$line'
+++ test_cmp_b='HEAD:submodule/sub/a:foobar
'
++ :
++ IFS=$'\r'
++ read -r -d '
' line
++ test -z ''
++ break
++ test -n 'HEAD:submodule/sub/a:foobar
'
++ test -n 'HEAD:submodule/sub/a:foobar
'
++ test 'HEAD:submodule/sub/a:foobar
' = 'HEAD:submodule/sub/a:foobar
'
+ test_eval_ret_=0
+ want_trace
+ test t = t
+ test t = t
+ set +x
ok 13 - grep tree and more pathspecs

expecting success: 
	git init parent &&
	test_when_finished "rm -rf parent" &&
	echo "foobar" >"parent/fi:le" &&
	git -C parent add "fi:le" &&
	git -C parent commit -m "add fi:le" &&

	git init "su:b" &&
	test_when_finished "rm -rf su:b" &&
	echo "foobar" >"su:b/fi:le" &&
	git -C "su:b" add "fi:le" &&
	git -C "su:b" commit -m "add fi:le" &&

	git -C parent submodule add "../su:b" "su:b" &&
	git -C parent commit -m "add submodule" &&

	cat >expect <<-\EOF &&
	fi:le:foobar
	su:b/fi:le:foobar
	EOF
	git -C parent grep -e "foobar" --recurse-submodules >actual &&
	test_cmp expect actual &&

	cat >expect <<-\EOF &&
	HEAD:fi:le:foobar
	HEAD:su:b/fi:le:foobar
	EOF
	git -C parent grep -e "foobar" --recurse-submodules HEAD >actual
&&
	test_cmp expect actual

++ git init parent
Initialized empty Git repository in C:/git-sdk-64/usr/src/git/wip3/t/trash
directory.t7814-grep-recurse-submodules/parent/.git/
++ test_when_finished 'rm -rf parent'
++ test 0 = 0
++ test_cleanup='{ rm -rf parent
		} && (exit "$eval_ret"); eval_ret=$?; :'
++ echo foobar
++ git -C parent add fi:le
fatal: pathspec 'fi:le' did not match any files
+ test_eval_ret_=128
+ want_trace
+ test t = t
+ test t = t
+ set +x
error: last command exited with $?=128
not ok 14 - grep recurse submodule colon in name
#	
#		git init parent &&
#		test_when_finished "rm -rf parent" &&
#		echo "foobar" >"parent/fi:le" &&
#		git -C parent add "fi:le" &&
#		git -C parent commit -m "add fi:le" &&
#	
#		git init "su:b" &&
#		test_when_finished "rm -rf su:b" &&
#		echo "foobar" >"su:b/fi:le" &&
#		git -C "su:b" add "fi:le" &&
#		git -C "su:b" commit -m "add fi:le" &&
#	
#		git -C parent submodule add "../su:b" "su:b" &&
#		git -C parent commit -m "add submodule" &&
#	
#		cat >expect <<-\EOF &&
#		fi:le:foobar
#		su:b/fi:le:foobar
#		EOF
#		git -C parent grep -e "foobar" --recurse-submodules
#		>actual &&
#		test_cmp expect actual &&
#	
#		cat >expect <<-\EOF &&
#		HEAD:fi:le:foobar
#		HEAD:su:b/fi:le:foobar
#		EOF
#		git -C parent grep -e "foobar" --recurse-submodules HEAD
#		>actual &&
#		test_cmp expect actual
#	




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]