Re: [PATCH 5/7] Fix tests under GETTEXT_POISON on pack-object

2012-08-21 Thread Nguyen Thai Ngoc Duy
On Tue, Aug 21, 2012 at 12:17 PM, Jonathan Nieder jrnie...@gmail.com wrote:
 --- a/t/t5530-upload-pack-error.sh
 +++ b/t/t5530-upload-pack-error.sh
 @@ -35,7 +35,7 @@ test_expect_success 'upload-pack fails due to error in 
 pack-objects packing' '
   printf 0032want %s\n0009done\n \
   $(git rev-parse HEAD) input 
   test_must_fail git upload-pack . input /dev/null 2output.err 
 - grep unable to read output.err 
 + test_i18ngrep unable to read output.err 
   grep pack-objects died output.err

 Wouldn't it make sense to change the second grep of output intended
 for humans to test_i18ngrep while at it?

This comes from error(git upload-pack: git-pack-objects died with
error.) in unpack-trees.c, which is not i18n-ized yet. There's
another test in t5530 that does the same grep. I think we should leave
it as is until we mark the string for translation, then gettext poison
will spot it (verified) and we can fix it.
-- 
Duy
--
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 5/7] Fix tests under GETTEXT_POISON on pack-object

2012-08-21 Thread Jonathan Nieder
Nguyen Thai Ngoc Duy wrote:
 On Tue, Aug 21, 2012 at 12:17 PM, Jonathan Nieder jrnie...@gmail.com wrote:

 @@ -35,7 +35,7 @@ test_expect_success 'upload-pack fails due to error in 
 pack-objects packing' '
   printf 0032want %s\n0009done\n \
   $(git rev-parse HEAD) input 
   test_must_fail git upload-pack . input /dev/null 2output.err 
 - grep unable to read output.err 
 + test_i18ngrep unable to read output.err 
   grep pack-objects died output.err

 Wouldn't it make sense to change the second grep of output intended
 for humans to test_i18ngrep while at it?

 This comes from error(git upload-pack: git-pack-objects died with
 error.) in unpack-trees.c, which is not i18n-ized yet. There's
 another test in t5530 that does the same grep. I think we should leave
 it as is until we mark the string for translation, then gettext poison
 will spot it (verified) and we can fix it.

I don't understand the distinction you're making.  Isn't the message
intended for humans, and wouldn't changing that one line to
test_i18ngrep now save trouble later?  Tests are meant to check git's
intended behavior, not to exactly match its current behavior.

Jonathan
--
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 5/7] Fix tests under GETTEXT_POISON on pack-object

2012-08-21 Thread Junio C Hamano
Jonathan Nieder jrnie...@gmail.com writes:

 Nguyen Thai Ngoc Duy wrote:
 On Tue, Aug 21, 2012 at 12:17 PM, Jonathan Nieder jrnie...@gmail.com wrote:

 @@ -35,7 +35,7 @@ test_expect_success 'upload-pack fails due to error in 
 pack-objects packing' '
   printf 0032want %s\n0009done\n \
   $(git rev-parse HEAD) input 
   test_must_fail git upload-pack . input /dev/null 2output.err 
 - grep unable to read output.err 
 + test_i18ngrep unable to read output.err 
   grep pack-objects died output.err

 Wouldn't it make sense to change the second grep of output intended
 for humans to test_i18ngrep while at it?

 This comes from error(git upload-pack: git-pack-objects died with
 error.) in unpack-trees.c, which is not i18n-ized yet. There's
 another test in t5530 that does the same grep. I think we should leave
 it as is until we mark the string for translation, then gettext poison
 will spot it (verified) and we can fix it.

 I don't understand the distinction you're making.  Isn't the message
 intended for humans, and wouldn't changing that one line to
 test_i18ngrep now save trouble later?  Tests are meant to check git's
 intended behavior, not to exactly match its current behavior.

Correct; your suggestion is good.
--
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 5/7] Fix tests under GETTEXT_POISON on pack-object

2012-08-20 Thread Nguyễn Thái Ngọc Duy
From: Jiang Xin worldhello@gmail.com

Use i18n-specific test functions in test scripts for pack-object.
This issue was was introduced in v1.7.10.2-556-g46140:

46140 index-pack: use streaming interface for collision test on large blobs
cf2ba pack-objects: use streaming interface for reading large loose blobs

and been broken under GETTEXT_POISON=YesPlease since.

Signed-off-by: Jiang Xin worldhello@gmail.com
Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com
---
 t/t5300-pack-object.sh   | 4 ++--
 t/t5530-upload-pack-error.sh | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/t/t5300-pack-object.sh b/t/t5300-pack-object.sh
index 2e52f8b..a07c871 100755
--- a/t/t5300-pack-object.sh
+++ b/t/t5300-pack-object.sh
@@ -416,11 +416,11 @@ test_expect_success \
 test_expect_success \
 'make sure index-pack detects the SHA1 collision' \
 'test_must_fail git index-pack -o bad.idx test-3.pack 2msg 
- grep SHA1 COLLISION FOUND msg'
+ test_i18ngrep SHA1 COLLISION FOUND msg'
 
 test_expect_success \
 'make sure index-pack detects the SHA1 collision (large blobs)' \
 'test_must_fail git -c core.bigfilethreshold=1 index-pack -o bad.idx 
test-3.pack 2msg 
- grep SHA1 COLLISION FOUND msg'
+ test_i18ngrep SHA1 COLLISION FOUND msg'
 
 test_done
diff --git a/t/t5530-upload-pack-error.sh b/t/t5530-upload-pack-error.sh
index 6b2a5f4..99f8dbc 100755
--- a/t/t5530-upload-pack-error.sh
+++ b/t/t5530-upload-pack-error.sh
@@ -35,7 +35,7 @@ test_expect_success 'upload-pack fails due to error in 
pack-objects packing' '
printf 0032want %s\n0009done\n \
$(git rev-parse HEAD) input 
test_must_fail git upload-pack . input /dev/null 2output.err 
-   grep unable to read output.err 
+   test_i18ngrep unable to read output.err 
grep pack-objects died output.err
 '
 
-- 
1.7.12.rc2

--
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 5/7] Fix tests under GETTEXT_POISON on pack-object

2012-08-20 Thread Jonathan Nieder
Hi,

Nguyễn Thái Ngọc Duy wrote:

 From: Jiang Xin worldhello@gmail.com

 Use i18n-specific test functions in test scripts for pack-object.

Thanks for resending, and sorry I haven't made time to polish the
translation-based poison implementation you sent before (which seemed
very useful and pleasant to work with).

[...]
 --- a/t/t5530-upload-pack-error.sh
 +++ b/t/t5530-upload-pack-error.sh
 @@ -35,7 +35,7 @@ test_expect_success 'upload-pack fails due to error in 
 pack-objects packing' '
   printf 0032want %s\n0009done\n \
   $(git rev-parse HEAD) input 
   test_must_fail git upload-pack . input /dev/null 2output.err 
 - grep unable to read output.err 
 + test_i18ngrep unable to read output.err 
   grep pack-objects died output.err

Wouldn't it make sense to change the second grep of output intended
for humans to test_i18ngrep while at it?

With or without that change, this and the rest of the series looks
good.

Hope that helps,
Jonathan
--
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