Re: [PATCHv3 11/11] t7810-grep: test --all-match with multiple --grep and --author options

2012-09-14 Thread Junio C Hamano
Michael J Gruber  writes:

> --all-match is ignored with multiple author options on purpose but
> requires all --grep to be matched on some line.

It is more like "the behaviour of --all-match to tie more than one --grep
used to be broken when --author or --committer is used".

>
> Signed-off-by: Michael J Gruber 
> ---
>  t/t7810-grep.sh | 20 
>  1 file changed, 20 insertions(+)
>
> diff --git a/t/t7810-grep.sh b/t/t7810-grep.sh
> index f6edb4d..b5c488e 100755
> --- a/t/t7810-grep.sh
> +++ b/t/t7810-grep.sh
> @@ -531,6 +531,16 @@ test_expect_success 'log --grep --grep --author takes 
> union of greps and interse
>   test_cmp expect actual
>  '
>  
> +test_expect_success 'log ---all-match -grep --author --author still takes 
> union of authors and intersects with grep' '
> + # grep matches only initial and third
> + # author matches all but second
> + git log --all-match --author="Thor" --author="Night" --grep=i 
> --format=%s >actual &&
> + {
> + echo third && echo initial
> + } >expect &&
> + test_cmp expect actual
> +'
> +
>  test_expect_success 'log --grep --author --author takes union of authors and 
> intersects with grep' '
>   # grep matches only initial and third
>   # author matches all but second
> @@ -541,6 +551,16 @@ test_expect_success 'log --grep --author --author takes 
> union of authors and int
>   test_cmp expect actual
>  '
>  
> +test_expect_success 'log --all-match --grep --grep --author takes 
> intersection' '
> + # grep matches only third
> + # author matches only initial and third
> + git log --all-match --author="A U Thor" --grep=i --grep=r --format=%s 
> >actual &&
> + {
> + echo third
> + } >expect &&
> + test_cmp expect actual
> +'
> +
>  test_expect_success 'grep with CE_VALID file' '
>   git update-index --assume-unchanged t/t &&
>   rm t/t &&
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCHv3 11/11] t7810-grep: test --all-match with multiple --grep and --author options

2012-09-14 Thread Michael J Gruber
--all-match is ignored with multiple author options on purpose but
requires all --grep to be matched on some line.

Signed-off-by: Michael J Gruber 
---
 t/t7810-grep.sh | 20 
 1 file changed, 20 insertions(+)

diff --git a/t/t7810-grep.sh b/t/t7810-grep.sh
index f6edb4d..b5c488e 100755
--- a/t/t7810-grep.sh
+++ b/t/t7810-grep.sh
@@ -531,6 +531,16 @@ test_expect_success 'log --grep --grep --author takes 
union of greps and interse
test_cmp expect actual
 '
 
+test_expect_success 'log ---all-match -grep --author --author still takes 
union of authors and intersects with grep' '
+   # grep matches only initial and third
+   # author matches all but second
+   git log --all-match --author="Thor" --author="Night" --grep=i 
--format=%s >actual &&
+   {
+   echo third && echo initial
+   } >expect &&
+   test_cmp expect actual
+'
+
 test_expect_success 'log --grep --author --author takes union of authors and 
intersects with grep' '
# grep matches only initial and third
# author matches all but second
@@ -541,6 +551,16 @@ test_expect_success 'log --grep --author --author takes 
union of authors and int
test_cmp expect actual
 '
 
+test_expect_success 'log --all-match --grep --grep --author takes 
intersection' '
+   # grep matches only third
+   # author matches only initial and third
+   git log --all-match --author="A U Thor" --grep=i --grep=r --format=%s 
>actual &&
+   {
+   echo third
+   } >expect &&
+   test_cmp expect actual
+'
+
 test_expect_success 'grep with CE_VALID file' '
git update-index --assume-unchanged t/t &&
rm t/t &&
-- 
1.7.12.592.g41e7905

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html