git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
* Test failure on Windows in t3705-add-sparse-checkout.sh
@ 2022-01-13 21:12 Johannes Sixt
  2022-01-15 14:58 ` [PATCH] t3705-add-sparse-checkout: ignore a LF->CRLF warning on Windows Johannes Sixt
  2022-01-16  3:58 ` Test failure on Windows in t3705-add-sparse-checkout.sh Elijah Newren
  0 siblings, 2 replies; 4+ messages in thread
From: Johannes Sixt @ 2022-01-13 21:12 UTC (permalink / raw)
  To: Derrick Stolee; +Cc: Git Mailing List

Hi Stolee,

is there a reason we don't do this in the test case that you added in
63b60b3add75 ("add: update --chmod to skip sparse paths", 2021-09-24).
Notice that the similar git add earlier also sets core.autocrlf. As the
comment indicates, stderr indeed contains a warning about LF->CRLF
conversion in my Windows build and fails test_must_be_empty.

diff --git a/t/t3705-add-sparse-checkout.sh b/t/t3705-add-sparse-checkout.sh
index 81f3384eee..4fb663e3b4 100755
--- a/t/t3705-add-sparse-checkout.sh
+++ b/t/t3705-add-sparse-checkout.sh
@@ -181,13 +181,13 @@ test_expect_success 'git add fails outside of sparse-checkout definition' '
 	# Avoid munging CRLFs to avoid an error message
 	git -c core.autocrlf=input add --sparse sparse_entry 2>stderr &&
 	test_must_be_empty stderr &&
 	git ls-files --stage >actual &&
 	grep "^100644 .*sparse_entry\$" actual &&
 
-	git add --sparse --chmod=+x sparse_entry 2>stderr &&
+	git -c core.autocrlf=input add --sparse --chmod=+x sparse_entry 2>stderr &&
 	test_must_be_empty stderr &&
 	git ls-files --stage >actual &&
 	grep "^100755 .*sparse_entry\$" actual &&
 
 	git reset &&
 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] t3705-add-sparse-checkout: ignore a LF->CRLF warning on Windows
  2022-01-13 21:12 Test failure on Windows in t3705-add-sparse-checkout.sh Johannes Sixt
@ 2022-01-15 14:58 ` Johannes Sixt
  2022-01-18 16:17   ` Derrick Stolee
  2022-01-16  3:58 ` Test failure on Windows in t3705-add-sparse-checkout.sh Elijah Newren
  1 sibling, 1 reply; 4+ messages in thread
From: Johannes Sixt @ 2022-01-15 14:58 UTC (permalink / raw)
  To: Derrick Stolee; +Cc: Git Mailing List

There are checks that certain `git add` invocations do not produce
output on stderr. One of them, the original one, uses
"-c core.autocrlf=input" to ensure that `git add` does not write a
hint about LF to CRLF conversion to stderr on Windows. A second
`git add` was added in later patch, but it was forgotten to add
the same protection. Add it now to let the test pass on Windows.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
---
Am 13.01.22 um 22:12 schrieb Johannes Sixt:
> is there a reason we don't do this in the test case that you added in
> 63b60b3add75 ("add: update --chmod to skip sparse paths", 2021-09-24).
> Notice that the similar git add earlier also sets core.autocrlf.

Here's a proper patch.

 t/t3705-add-sparse-checkout.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/t3705-add-sparse-checkout.sh b/t/t3705-add-sparse-checkout.sh
index 81f3384eee..4fb663e3b4 100755
--- a/t/t3705-add-sparse-checkout.sh
+++ b/t/t3705-add-sparse-checkout.sh
@@ -184,7 +184,7 @@ test_expect_success 'git add fails outside of sparse-checkout definition' '
 	git ls-files --stage >actual &&
 	grep "^100644 .*sparse_entry\$" actual &&
 
-	git add --sparse --chmod=+x sparse_entry 2>stderr &&
+	git -c core.autocrlf=input add --sparse --chmod=+x sparse_entry 2>stderr &&
 	test_must_be_empty stderr &&
 	git ls-files --stage >actual &&
 	grep "^100755 .*sparse_entry\$" actual &&
-- 
2.34.1.141.g867d0e9267

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Test failure on Windows in t3705-add-sparse-checkout.sh
  2022-01-13 21:12 Test failure on Windows in t3705-add-sparse-checkout.sh Johannes Sixt
  2022-01-15 14:58 ` [PATCH] t3705-add-sparse-checkout: ignore a LF->CRLF warning on Windows Johannes Sixt
@ 2022-01-16  3:58 ` Elijah Newren
  1 sibling, 0 replies; 4+ messages in thread
From: Elijah Newren @ 2022-01-16  3:58 UTC (permalink / raw)
  To: Johannes Sixt; +Cc: Derrick Stolee, Git Mailing List

On Fri, Jan 14, 2022 at 12:30 AM Johannes Sixt <j6t@kdbg.org> wrote:
>
> Hi Stolee,
>
> is there a reason we don't do this in the test case that you added in
> 63b60b3add75 ("add: update --chmod to skip sparse paths", 2021-09-24).
> Notice that the similar git add earlier also sets core.autocrlf. As the
> comment indicates, stderr indeed contains a warning about LF->CRLF
> conversion in my Windows build and fails test_must_be_empty.
>
> diff --git a/t/t3705-add-sparse-checkout.sh b/t/t3705-add-sparse-checkout.sh
> index 81f3384eee..4fb663e3b4 100755
> --- a/t/t3705-add-sparse-checkout.sh
> +++ b/t/t3705-add-sparse-checkout.sh
> @@ -181,13 +181,13 @@ test_expect_success 'git add fails outside of sparse-checkout definition' '
>         # Avoid munging CRLFs to avoid an error message
>         git -c core.autocrlf=input add --sparse sparse_entry 2>stderr &&
>         test_must_be_empty stderr &&
>         git ls-files --stage >actual &&
>         grep "^100644 .*sparse_entry\$" actual &&
>
> -       git add --sparse --chmod=+x sparse_entry 2>stderr &&
> +       git -c core.autocrlf=input add --sparse --chmod=+x sparse_entry 2>stderr &&
>         test_must_be_empty stderr &&
>         git ls-files --stage >actual &&
>         grep "^100755 .*sparse_entry\$" actual &&
>
>         git reset &&

Is this an alternative fix for the same failure I was seeing in t3705
and which I was confused why I had to add to my series over at
https://lore.kernel.org/git/11d46a399d26c913787b704d2b7169cafc28d639.1642175983.git.gitgitgadget@gmail.com/
?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] t3705-add-sparse-checkout: ignore a LF->CRLF warning on Windows
  2022-01-15 14:58 ` [PATCH] t3705-add-sparse-checkout: ignore a LF->CRLF warning on Windows Johannes Sixt
@ 2022-01-18 16:17   ` Derrick Stolee
  0 siblings, 0 replies; 4+ messages in thread
From: Derrick Stolee @ 2022-01-18 16:17 UTC (permalink / raw)
  To: Johannes Sixt, Derrick Stolee; +Cc: Git Mailing List

On 1/15/2022 9:58 AM, Johannes Sixt wrote:
> There are checks that certain `git add` invocations do not produce
> output on stderr. One of them, the original one, uses
> "-c core.autocrlf=input" to ensure that `git add` does not write a
> hint about LF to CRLF conversion to stderr on Windows. A second
> `git add` was added in later patch, but it was forgotten to add
> the same protection. Add it now to let the test pass on Windows.
> 
> Signed-off-by: Johannes Sixt <j6t@kdbg.org>
> ---
> Am 13.01.22 um 22:12 schrieb Johannes Sixt:
>> is there a reason we don't do this in the test case that you added in
>> 63b60b3add75 ("add: update --chmod to skip sparse paths", 2021-09-24).
>> Notice that the similar git add earlier also sets core.autocrlf.
> 
> Here's a proper patch.

Thanks for this fix. I'm not sure why this fails on your Windows
machine but passes the Windows CI builds. Glad to have the fix
either way.
> -	git add --sparse --chmod=+x sparse_entry 2>stderr &&
> +	git -c core.autocrlf=input add --sparse --chmod=+x sparse_entry 2>stderr &&

Thanks,
-Stolee

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-01-18 16:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-13 21:12 Test failure on Windows in t3705-add-sparse-checkout.sh Johannes Sixt
2022-01-15 14:58 ` [PATCH] t3705-add-sparse-checkout: ignore a LF->CRLF warning on Windows Johannes Sixt
2022-01-18 16:17   ` Derrick Stolee
2022-01-16  3:58 ` Test failure on Windows in t3705-add-sparse-checkout.sh Elijah Newren

Code repositories for project(s) associated with this inbox:

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).