Re: [PATCH 4/6] t4210: skip command-line encoding tests on mingw

2014-07-21 Thread Junio C Hamano
Junio C Hamano  writes:

> So here is the first of the two small/trivial patch series. 
>
> To prepare the first one, I did "git grep -e '\ result of applying Stepan's series and edited the hits manually.
> And then compared the result with running
>
>  $ perl -p -i -e 'if (!/\btest_set_prereq\s/) {
>s/\bNOT_([A-Z]*)\b/!$1/g
>}' t/t*.sh
>
> on Stepan's series to see if I missed anything.
>
> The second one was discovered while doing the manual fix mentioned
> above.
> ...
>  t/t1402-check-ref-format.sh   | 32 
>  t/test-lib.sh |  4 
>  15 files changed, 52 insertions(+), 56 deletions(-)

Unfortunately, t1402 needs more work X-<.
--
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


Re: [PATCH 4/6] t4210: skip command-line encoding tests on mingw

2014-07-21 Thread Junio C Hamano
Junio C Hamano  writes:

> Junio C Hamano  writes:
>
>> Oh by the way, can somebody remind me why we spell these as
>> NOT_MINGW,  instead of !MINGW?
>
> Simple answer seems to be that !ANYTHING appeared only at bdccd3c1
> (test-lib: allow negation of prerequisites, 2012-11-14) but at that
> version already 5 test files use NOT_MINGW (and a few MINGW) as
> prerequisites.  We can safely replace uses of NOT_MINGW prerequisite
> with !MINGW, it seems.
>
> Sorry for the noise.

So here is the first of the two small/trivial patch series. 

To prepare the first one, I did "git grep -e '\8 --
Subject: [PATCH 1/2] test prerequisites: eradicate NOT_FOO

Support for Back when bdccd3c1 (test-lib: allow negation of
prerequisites, 2012-11-14) introduced negated predicates
(e.g. "!MINGW,!CYGWIN"), we already had 5 test files that use
NOT_MINGW (and a few MINGW) as prerequisites.

Let's not add NOT_FOO and rewrite existing ones as !FOO for both
MINGW and CYGWIN.

Signed-off-by: Junio C Hamano 
---
 t/t0008-ignores.sh|  2 +-
 t/t0081-line-buffer.sh|  2 +-
 t/t1020-subdirectory.sh   |  2 +-
 t/t1300-repo-config.sh|  6 +++---
 t/t1402-check-ref-format.sh   | 32 
 t/t3901-i18n-patch.sh | 10 +-
 t/t4201-shortlog.sh   |  6 +++---
 t/t4210-log-i18n.sh   |  4 ++--
 t/t5601-clone.sh  |  4 ++--
 t/t8005-blame-i18n.sh |  8 
 t/t9300-fast-import.sh|  8 
 t/t9809-git-p4-client-view.sh |  4 ++--
 t/t9812-git-p4-wildcards.sh   | 14 +++---
 t/t9815-git-p4-submit-fail.sh |  2 +-
 t/test-lib.sh |  4 
 15 files changed, 52 insertions(+), 56 deletions(-)

diff --git a/t/t0008-ignores.sh b/t/t0008-ignores.sh
index 39e55a1..8dc6939 100755
--- a/t/t0008-ignores.sh
+++ b/t/t0008-ignores.sh
@@ -806,7 +806,7 @@ test_expect_success !MINGW 'quoting allows trailing 
whitespace' '
test_cmp err.expect err
 '
 
-test_expect_success NOT_MINGW,NOT_CYGWIN 'correct handling of backslashes' '
+test_expect_success !MINGW,!CYGWIN 'correct handling of backslashes' '
rm -rf whitespace &&
mkdir whitespace &&
>"whitespace/trailing 1  " &&
diff --git a/t/t0081-line-buffer.sh b/t/t0081-line-buffer.sh
index 25dba00..ce92e6a 100755
--- a/t/t0081-line-buffer.sh
+++ b/t/t0081-line-buffer.sh
@@ -29,7 +29,7 @@ test_expect_success '0-length read, send along greeting' '
test_cmp expect actual
 '
 
-test_expect_success NOT_MINGW 'read from file descriptor' '
+test_expect_success !MINGW 'read from file descriptor' '
rm -f input &&
echo hello >expect &&
echo hello >input &&
diff --git a/t/t1020-subdirectory.sh b/t/t1020-subdirectory.sh
index 62c0d25..2edb4f2 100755
--- a/t/t1020-subdirectory.sh
+++ b/t/t1020-subdirectory.sh
@@ -118,7 +118,7 @@ test_expect_success 'alias expansion' '
)
 '
 
-test_expect_success NOT_MINGW '!alias expansion' '
+test_expect_success !MINGW '!alias expansion' '
pwd >expect &&
(
git config alias.test-alias-directory !pwd &&
diff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh
index 3f80ff0..fb871d0 100755
--- a/t/t1300-repo-config.sh
+++ b/t/t1300-repo-config.sh
@@ -824,14 +824,14 @@ cat >expect <<\EOF
trailingtilde = foo~
 EOF
 
-test_expect_success NOT_MINGW 'set --path' '
+test_expect_success !MINGW 'set --path' '
rm -f .git/config &&
git config --path path.home "~/" &&
git config --path path.normal "/dev/null" &&
git config --path path.trailingtilde "foo~" &&
test_cmp expect .git/config'
 
-if test_have_prereq NOT_MINGW && test "${HOME+set}"
+if test_have_prereq !MINGW && test "${HOME+set}"
 then
test_set_prereq HOMEVAR
 fi
@@ -854,7 +854,7 @@ cat >expect <<\EOF
 foo~
 EOF
 
-test_expect_success NOT_MINGW 'get --path copes with unset $HOME' '
+test_expect_success !MINGW 'get --path copes with unset $HOME' '
(
unset HOME;
test_must_fail git config --get --path path.home \
diff --git a/t/t1402-check-ref-format.sh b/t/t1402-check-ref-format.sh
index 9aeb352..72fd917 100755
--- a/t/t1402-check-ref-format.sh
+++ b/t/t1402-check-ref-format.sh
@@ -30,17 +30,17 @@ invalid_ref() {
 }
 
 invalid_ref ''
-invalid_ref NOT_MINGW '/'
-invalid_ref NOT_MINGW '/' --allow-onelevel
-invalid_ref NOT_MINGW '/' --normalize
-invalid_ref NOT_MINGW '/' '--allow-onelevel --normalize'
+invalid_ref !MINGW '/'
+invalid_ref !MINGW '/' --allow-onelevel
+invalid_ref !MINGW '/' --normalize
+invalid_ref !MINGW '/' '--allow-onelevel --normalize'
 valid_ref 'foo/bar/baz'
 valid_ref 'foo/bar/baz' --normalize
 invalid_ref 'refs///heads/foo'
 valid_ref 'refs///heads/foo' --normalize
 invalid_ref 'heads/foo/'
-invalid_ref NOT_MINGW '/heads/foo'
-valid_ref NOT_MINGW '/heads/foo' --normalize
+invalid_ref !MINGW '/heads/foo'
+valid_ref !MINGW '/heads/foo' --normalize
 invalid_ref '///heads/foo'
 valid_ref '///heads/foo'

Re: [PATCH 4/6] t4210: skip command-line encoding tests on mingw

2014-07-21 Thread Junio C Hamano
Junio C Hamano  writes:

> Oh by the way, can somebody remind me why we spell these as
> NOT_MINGW,  instead of !MINGW?

Simple answer seems to be that !ANYTHING appeared only at bdccd3c1
(test-lib: allow negation of prerequisites, 2012-11-14) but at that
version already 5 test files use NOT_MINGW (and a few MINGW) as
prerequisites.  We can safely replace uses of NOT_MINGW prerequisite
with !MINGW, it seems.

Sorry for the noise.


--
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


Re: [msysGit] Re: [PATCH 4/6] t4210: skip command-line encoding tests on mingw

2014-07-21 Thread Johannes Sixt
Am 21.07.2014 19:45, schrieb Johannes Schindelin:
> Hi Junio,
> 
> On Mon, 21 Jul 2014, Junio C Hamano wrote:
> 
>> Oh by the way, can somebody remind me why we spell these as
>> NOT_MINGW,  instead of !MINGW?
> 
> I guess that is my mistake; when I introduced the use of NOT_MINGW I was
> simply unaware of the !MINGW syntax.

You can hardly be blamed. The first occurrence of NOT_MINGW was added
much earlier than the ability to negate prerequisite tokens.

> Let's use the latter consistently?

Of course!

-- Hannes

--
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


Re: [msysGit] Re: [PATCH 4/6] t4210: skip command-line encoding tests on mingw

2014-07-21 Thread Johannes Schindelin
Hi Junio,

On Mon, 21 Jul 2014, Junio C Hamano wrote:

> Oh by the way, can somebody remind me why we spell these as
> NOT_MINGW,  instead of !MINGW?

I guess that is my mistake; when I introduced the use of NOT_MINGW I was
simply unaware of the !MINGW syntax.

Let's use the latter consistently?

Ciao,
Johannes
--
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


Re: [PATCH 4/6] t4210: skip command-line encoding tests on mingw

2014-07-21 Thread Junio C Hamano
Erik Faye-Lund  writes:

> On Thu, Jul 17, 2014 at 5:37 PM, Stepan Kasal  wrote:
>> From: Pat Thoyts 
>>
>> On Windows the application command line is provided as unicode and in
>> mingw-git we convert that to utf-8. So these tests that require a iso-8859-1
>> input are being subverted by the encoding transformations we perform and
>> should be skipped.
>> ...
>> -test_expect_success 'log --grep searches in log output encoding (latin1)' '
>> +test_expect_success NOT_MINGW 'log --grep searches in log output encoding 
>> (latin1)' '
>> cat >expect <<-\EOF &&
>> latin1
>> utf8
>> @@ -43,7 +43,7 @@ test_expect_success 'log --grep searches in log output 
>> encoding (latin1)' '
>> test_cmp expect actual
>>  '
>>
>> -test_expect_success 'log --grep does not find non-reencoded values (utf8)' '
>> +test_expect_success NOT_MINGW 'log --grep does not find non-reencoded 
>> values (utf8)' '
>
> Perhaps these checks would be more readable a few years in the future,
> if we make a separate capability along the lines of
> NON_UNICODE_LOCALE?

I do agree that having "unicode" and possibly also "locale" and
dropping "mingw" from the prerequisite makes sense, especially in
the longer term.  Please make it so _after_ the dust settles.

I however suspect that NON_UNICODE_LOCALE does not read quite well;
isn't the trouble that mingw allows nothing but unicode strings on
the command line (there is no trouble for non unicode strings that
appear as payload)?

Oh by the way, can somebody remind me why we spell these as
NOT_MINGW,  instead of !MINGW?




--
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


Re: [msysGit] [PATCH 4/6] t4210: skip command-line encoding tests on mingw

2014-07-18 Thread Erik Faye-Lund
On Thu, Jul 17, 2014 at 5:37 PM, Stepan Kasal  wrote:
> From: Pat Thoyts 
>
> On Windows the application command line is provided as unicode and in
> mingw-git we convert that to utf-8. So these tests that require a iso-8859-1
> input are being subverted by the encoding transformations we perform and
> should be skipped.
>
> Signed-off-by: Pat Thoyts 
> Signed-off-by: Stepan Kasal 
> ---
>  t/t4210-log-i18n.sh | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/t/t4210-log-i18n.sh b/t/t4210-log-i18n.sh
> index 52a7472..9110404 100755
> --- a/t/t4210-log-i18n.sh
> +++ b/t/t4210-log-i18n.sh
> @@ -34,7 +34,7 @@ test_expect_success 'log --grep searches in log output 
> encoding (utf8)' '
> test_cmp expect actual
>  '
>
> -test_expect_success 'log --grep searches in log output encoding (latin1)' '
> +test_expect_success NOT_MINGW 'log --grep searches in log output encoding 
> (latin1)' '
> cat >expect <<-\EOF &&
> latin1
> utf8
> @@ -43,7 +43,7 @@ test_expect_success 'log --grep searches in log output 
> encoding (latin1)' '
> test_cmp expect actual
>  '
>
> -test_expect_success 'log --grep does not find non-reencoded values (utf8)' '
> +test_expect_success NOT_MINGW 'log --grep does not find non-reencoded values 
> (utf8)' '

Perhaps these checks would be more readable a few years in the future,
if we make a separate capability along the lines of
NON_UNICODE_LOCALE?
--
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


[PATCH 4/6] t4210: skip command-line encoding tests on mingw

2014-07-17 Thread Stepan Kasal
From: Pat Thoyts 

On Windows the application command line is provided as unicode and in
mingw-git we convert that to utf-8. So these tests that require a iso-8859-1
input are being subverted by the encoding transformations we perform and
should be skipped.

Signed-off-by: Pat Thoyts 
Signed-off-by: Stepan Kasal 
---
 t/t4210-log-i18n.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/t/t4210-log-i18n.sh b/t/t4210-log-i18n.sh
index 52a7472..9110404 100755
--- a/t/t4210-log-i18n.sh
+++ b/t/t4210-log-i18n.sh
@@ -34,7 +34,7 @@ test_expect_success 'log --grep searches in log output 
encoding (utf8)' '
test_cmp expect actual
 '
 
-test_expect_success 'log --grep searches in log output encoding (latin1)' '
+test_expect_success NOT_MINGW 'log --grep searches in log output encoding 
(latin1)' '
cat >expect <<-\EOF &&
latin1
utf8
@@ -43,7 +43,7 @@ test_expect_success 'log --grep searches in log output 
encoding (latin1)' '
test_cmp expect actual
 '
 
-test_expect_success 'log --grep does not find non-reencoded values (utf8)' '
+test_expect_success NOT_MINGW 'log --grep does not find non-reencoded values 
(utf8)' '
>expect &&
git log --encoding=utf8 --format=%s --grep=$latin1_e >actual &&
test_cmp expect actual
-- 
2.0.0.9635.g0be03cb

--
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