Re: [PATCH 2/4] t1000: modernize style

2017-01-10 Thread Junio C Hamano
Stefan Beller  writes:

> On Tue, Jan 10, 2017 at 12:37 PM, Junio C Hamano  wrote:
>> Stefan Beller  writes:
>>
>>> The preferred style in tests seems to be
>>
>> s/seems to be/is/;
>
> If this is the only nit, mind to fix up the commit message locally?

Certainly.  It wasn't even meant as a "nitpick".  I was just
confirming your observation.


Re: [PATCH 2/4] t1000: modernize style

2017-01-10 Thread Stefan Beller
On Tue, Jan 10, 2017 at 12:37 PM, Junio C Hamano  wrote:
> Stefan Beller  writes:
>
>> The preferred style in tests seems to be
>
> s/seems to be/is/;

If this is the only nit, mind to fix up the commit message locally?
(I was even unsure if we want to have this patch as part
of a larger series, as it is just refactoring for the sake of refactoring,
i.e. t1000 doesn't see a new test in this series, only t1001 does)

>
>>
>> test_expect_success 'short description, ended by 2 single quotes' '
>>   here comes the test &&
>>   and chains over many lines &&
>>   ended by a quote
>> '
>
> Thanks.  This is way overdue.  During the time the script has been
> dormant for more than two years, we should have done this.

agreed.


Re: [PATCH 2/4] t1000: modernize style

2017-01-10 Thread Junio C Hamano
Stefan Beller  writes:

> The preferred style in tests seems to be

s/seems to be/is/;

>
> test_expect_success 'short description, ended by 2 single quotes' '
>   here comes the test &&
>   and chains over many lines &&
>   ended by a quote
> '

Thanks.  This is way overdue.  During the time the script has been
dormant for more than two years, we should have done this.


[PATCH 2/4] t1000: modernize style

2017-01-09 Thread Stefan Beller
The preferred style in tests seems to be

test_expect_success 'short description, ended by 2 single quotes' '
here comes the test &&
and chains over many lines &&
ended by a quote
'

Or going by the numbers:
$ git -C t/ grep "' '$" | wc -l
9796
$ git -C t/ grep test_expect_ |wc -l
11861

Signed-off-by: Stefan Beller 
---
 t/t1000-read-tree-m-3way.sh | 648 +---
 1 file changed, 315 insertions(+), 333 deletions(-)

diff --git a/t/t1000-read-tree-m-3way.sh b/t/t1000-read-tree-m-3way.sh
index a0b79b4839..3c4d2d6045 100755
--- a/t/t1000-read-tree-m-3way.sh
+++ b/t/t1000-read-tree-m-3way.sh
@@ -128,29 +128,29 @@ cat >expected <<\EOF
 EOF
 
 check_result () {
-git ls-files --stage | sed -e 's/ '"$_x40"' / X /' >current &&
-test_cmp expected current
+   git ls-files --stage | sed -e 's/ '"$_x40"' / X /' >current &&
+   test_cmp expected current
 }
 
 # This is done on an empty work directory, which is the normal
 # merge person behaviour.
-test_expect_success \
-'3-way merge with git read-tree -m, empty cache' \
-"rm -fr [NDMALTS][NDMALTSF] Z &&
- rm .git/index &&
- read_tree_must_succeed -m $tree_O $tree_A $tree_B &&
- check_result"
+test_expect_success '3-way merge with git read-tree -m, empty cache' '
+   rm -fr [NDMALTS][NDMALTSF] Z &&
+   rm .git/index &&
+   read_tree_must_succeed -m $tree_O $tree_A $tree_B &&
+   check_result
+'
 
 # This starts out with the first head, which is the normal
 # patch submitter behaviour.
-test_expect_success \
-'3-way merge with git read-tree -m, match H' \
-"rm -fr [NDMALTS][NDMALTSF] Z &&
- rm .git/index &&
- read_tree_must_succeed $tree_A &&
- git checkout-index -f -u -a &&
- read_tree_must_succeed -m $tree_O $tree_A $tree_B &&
- check_result"
+test_expect_success '3-way merge with git read-tree -m, match H' '
+   rm -fr [NDMALTS][NDMALTSF] Z &&
+   rm .git/index &&
+   read_tree_must_succeed $tree_A &&
+   git checkout-index -f -u -a &&
+   read_tree_must_succeed -m $tree_O $tree_A $tree_B &&
+   check_result
+'
 
 : <<\END_OF_CASE_TABLE
 
@@ -208,322 +208,304 @@ DF (file) when tree B require DF to be a directory by 
having DF/DF
 
 END_OF_CASE_TABLE
 
-test_expect_success '1 - must not have an entry not in A.' "
- rm -f .git/index XX &&
- echo XX >XX &&
- git update-index --add XX &&
- read_tree_must_fail -m $tree_O $tree_A $tree_B
-"
-
-test_expect_success \
-'2 - must match B in !O && !A && B case.' \
-"rm -f .git/index NA &&
- cp .orig-B/NA NA &&
- git update-index --add NA &&
- read_tree_must_succeed -m $tree_O $tree_A $tree_B"
-
-test_expect_success \
-'2 - matching B alone is OK in !O && !A && B case.' \
-"rm -f .git/index NA &&
- cp .orig-B/NA NA &&
- git update-index --add NA &&
- echo extra >>NA &&
- read_tree_must_succeed -m $tree_O $tree_A $tree_B"
-
-test_expect_success \
-'3 - must match A in !O && A && !B case.' \
-"rm -f .git/index AN &&
- cp .orig-A/AN AN &&
- git update-index --add AN &&
- read_tree_must_succeed -m $tree_O $tree_A $tree_B &&
- check_result"
-
-test_expect_success \
-'3 - matching A alone is OK in !O && A && !B case.' \
-"rm -f .git/index AN &&
- cp .orig-A/AN AN &&
- git update-index --add AN &&
- echo extra >>AN &&
- read_tree_must_succeed -m $tree_O $tree_A $tree_B"
-
-test_expect_success \
-'3 (fail) - must match A in !O && A && !B case.' "
- rm -f .git/index AN &&
- cp .orig-A/AN AN &&
- echo extra >>AN &&
- git update-index --add AN &&
- read_tree_must_fail -m $tree_O $tree_A $tree_B
-"
-
-test_expect_success \
-'4 - must match and be up-to-date in !O && A && B && A!=B case.' \
-"rm -f .git/index AA &&
- cp .orig-A/AA AA &&
- git update-index --add AA &&
- read_tree_must_succeed -m $tree_O $tree_A $tree_B &&
- check_result"
-
-test_expect_success \
-'4 (fail) - must match and be up-to-date in !O && A && B && A!=B case.' "
- rm -f .git/index AA &&
- cp .orig-A/AA AA &&
- git update-index --add AA &&
- echo extra >>AA &&
- read_tree_must_fail -m $tree_O $tree_A $tree_B
-"
-
-test_expect_success \
-'4 (fail) - must match and be up-to-date in !O && A && B && A!=B case.' "
- rm -f .git/index AA &&
- cp .orig-A/AA AA &&
- echo extra >>AA &&
- git update-index --add AA &&
- read_tree_must_fail -m $tree_O $tree_A $tree_B
-"
-
-test_expect_success \
-'5 - must match in !O && A && B && A==B case.' \
-"rm -f .git/index LL &&
- cp .orig-A/LL LL &&
- git update-index --add LL &&
- read_tree_must_succeed -m $tree_O $tree_A $tree_B &&
- check_result"
-
-test_expect_success \
-'5 - must match in !O && A && B && A==B case.' \
-"rm -f .git/index LL &&
- cp .orig-A/LL LL &&
- git update-index --add LL &&
-