All of lore.kernel.org
 help / color / mirror / Atom feed
* Mini bug report origin/pu: t1512 failed on Mac OS X (commit  957d74062c1f0e ?)
@ 2012-07-11 20:09 Torsten Bögershausen
  2012-07-11 23:05 ` Junio C Hamano
  0 siblings, 1 reply; 7+ messages in thread
From: Torsten Bögershausen @ 2012-07-11 20:09 UTC (permalink / raw)
  To: Git Mailing List; +Cc: Torsten Bögershausen

The following tweak will make t1512 work on my Mac OS box:


--- a/t/t1512-rev-parse-disambiguation.sh
+++ b/t/t1512-rev-parse-disambiguation.sh
@@ -257,7 +257,7 @@ test_expect_success 'rev-parse --disambiguate' '
        # commits created by commit-tree in earlier tests do not share
        # the prefix.
        git rev-parse --disambiguate=000000000 >actual &&
-       test "$(wc -l <actual)" = 16 &&
+       test "$(wc -l <actual)" -eq  16 &&
        test "$(sed -e "s/^\(.........\).*/\1/" actual | sort -u)" = 000000000



/Torsten

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

* Re: Mini bug report origin/pu: t1512 failed on Mac OS X (commit  957d74062c1f0e ?)
  2012-07-11 20:09 Mini bug report origin/pu: t1512 failed on Mac OS X (commit 957d74062c1f0e ?) Torsten Bögershausen
@ 2012-07-11 23:05 ` Junio C Hamano
  2012-07-11 23:30   ` Junio C Hamano
  0 siblings, 1 reply; 7+ messages in thread
From: Junio C Hamano @ 2012-07-11 23:05 UTC (permalink / raw)
  To: Torsten Bögershausen; +Cc: Git Mailing List

Torsten Bögershausen <tboegi@web.de> writes:

> The following tweak will make t1512 work on my Mac OS box:
>
>
> --- a/t/t1512-rev-parse-disambiguation.sh
> +++ b/t/t1512-rev-parse-disambiguation.sh
> @@ -257,7 +257,7 @@ test_expect_success 'rev-parse --disambiguate' '
>         # commits created by commit-tree in earlier tests do not share
>         # the prefix.
>         git rev-parse --disambiguate=000000000 >actual &&
> -       test "$(wc -l <actual)" = 16 &&
> +       test "$(wc -l <actual)" -eq  16 &&

I think the other tests in t/ prefer to unquote it so that we would
ignore spaces around "wc -l" output, i.e.

	test $(wc -l <actual) = 16

Thanks for a report.

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

* Re: Mini bug report origin/pu: t1512 failed on Mac OS X (commit  957d74062c1f0e ?)
  2012-07-11 23:05 ` Junio C Hamano
@ 2012-07-11 23:30   ` Junio C Hamano
  2012-07-12  7:21     ` Johannes Sixt
  2012-07-13 22:43     ` Stefano Lattarini
  0 siblings, 2 replies; 7+ messages in thread
From: Junio C Hamano @ 2012-07-11 23:30 UTC (permalink / raw)
  To: Torsten Bögershausen; +Cc: Git Mailing List

Junio C Hamano <gitster@pobox.com> writes:

> I think the other tests in t/ prefer to unquote it so that we would
> ignore spaces around "wc -l" output, i.e.
>
> 	test $(wc -l <actual) = 16
>
> Thanks for a report.

-- >8 --
Subject: [PATCH] t1512: ignore whitespaces in wc -l output

Some implementations of sed (e.g. MacOS X) have whitespaces in the
output of "wc -l" that reads from the standard input.  Ignore these
whitespaces by not quoting the command substitution to be compared
with the constant "16".

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 t/t1512-rev-parse-disambiguation.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/t1512-rev-parse-disambiguation.sh b/t/t1512-rev-parse-disambiguation.sh
index 3ed7558..1eb3514 100755
--- a/t/t1512-rev-parse-disambiguation.sh
+++ b/t/t1512-rev-parse-disambiguation.sh
@@ -257,7 +257,7 @@ test_expect_success 'rev-parse --disambiguate' '
 	# commits created by commit-tree in earlier tests do not share
 	# the prefix.
 	git rev-parse --disambiguate=000000000 >actual &&
-	test "$(wc -l <actual)" = 16 &&
+	test $(wc -l <actual) = 16 &&
 	test "$(sed -e "s/^\(.........\).*/\1/" actual | sort -u)" = 000000000
 '
 
-- 
1.7.11.2.270.gc2d3e4b

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

* Re: Mini bug report origin/pu: t1512 failed on Mac OS X (commit  957d74062c1f0e ?)
  2012-07-11 23:30   ` Junio C Hamano
@ 2012-07-12  7:21     ` Johannes Sixt
  2012-07-12 16:58       ` Junio C Hamano
  2012-07-13 22:43     ` Stefano Lattarini
  1 sibling, 1 reply; 7+ messages in thread
From: Johannes Sixt @ 2012-07-12  7:21 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Torsten Bögershausen, Git Mailing List

Am 7/12/2012 1:30, schrieb Junio C Hamano:
> -	test "$(wc -l <actual)" = 16 &&
> +	test $(wc -l <actual) = 16 &&

We have a helper function for this:

	test_line_count = 16 actual &&

-- Hannes

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

* Re: Mini bug report origin/pu: t1512 failed on Mac OS X (commit  957d74062c1f0e ?)
  2012-07-12  7:21     ` Johannes Sixt
@ 2012-07-12 16:58       ` Junio C Hamano
  0 siblings, 0 replies; 7+ messages in thread
From: Junio C Hamano @ 2012-07-12 16:58 UTC (permalink / raw)
  To: Johannes Sixt; +Cc: Torsten Bögershausen, Git Mailing List

Johannes Sixt <j.sixt@viscovery.net> writes:

> Am 7/12/2012 1:30, schrieb Junio C Hamano:
>> -	test "$(wc -l <actual)" = 16 &&
>> +	test $(wc -l <actual) = 16 &&
>
> We have a helper function for this:
>
> 	test_line_count = 16 actual &&

OK.

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

* Re: Mini bug report origin/pu: t1512 failed on Mac OS X (commit 957d74062c1f0e ?)
  2012-07-11 23:30   ` Junio C Hamano
  2012-07-12  7:21     ` Johannes Sixt
@ 2012-07-13 22:43     ` Stefano Lattarini
  2012-07-13 23:31       ` Junio C Hamano
  1 sibling, 1 reply; 7+ messages in thread
From: Stefano Lattarini @ 2012-07-13 22:43 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Torsten Bögershausen, Git Mailing List

On 07/12/2012 01:30 AM, Junio C Hamano wrote:
> Junio C Hamano <gitster@pobox.com> writes:
> 
>> I think the other tests in t/ prefer to unquote it so that we would
>> ignore spaces around "wc -l" output, i.e.
>>
>> 	test $(wc -l <actual) = 16
>>
>> Thanks for a report.
> 
> -- >8 --
> Subject: [PATCH] t1512: ignore whitespaces in wc -l output
> 
> Some implementations of sed (e.g. MacOS X)
>
'sed'?  Shouldn't this read 'wc'?

> have whitespaces in the output of "wc -l" that reads from the standard
> input.
>
FYI, the extra space is present with Solaris wc as well:

$ wc -l </dev/null
       0

Regards,
  Stefano

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

* Re: Mini bug report origin/pu: t1512 failed on Mac OS X (commit 957d74062c1f0e ?)
  2012-07-13 22:43     ` Stefano Lattarini
@ 2012-07-13 23:31       ` Junio C Hamano
  0 siblings, 0 replies; 7+ messages in thread
From: Junio C Hamano @ 2012-07-13 23:31 UTC (permalink / raw)
  To: Stefano Lattarini; +Cc: Torsten Bögershausen, Git Mailing List

Stefano Lattarini <stefano.lattarini@gmail.com> writes:

> On 07/12/2012 01:30 AM, Junio C Hamano wrote:
>> Junio C Hamano <gitster@pobox.com> writes:
>> 
>>> I think the other tests in t/ prefer to unquote it so that we would
>>> ignore spaces around "wc -l" output, i.e.
>>>
>>> 	test $(wc -l <actual) = 16
>>>
>>> Thanks for a report.
>> 
>> -- >8 --
>> Subject: [PATCH] t1512: ignore whitespaces in wc -l output
>> 
>> Some implementations of sed (e.g. MacOS X)
>>
> 'sed'?  Shouldn't this read 'wc'?

Heh, funny typo.  I don't know what I was thinking.

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

end of thread, other threads:[~2012-07-13 23:31 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-11 20:09 Mini bug report origin/pu: t1512 failed on Mac OS X (commit 957d74062c1f0e ?) Torsten Bögershausen
2012-07-11 23:05 ` Junio C Hamano
2012-07-11 23:30   ` Junio C Hamano
2012-07-12  7:21     ` Johannes Sixt
2012-07-12 16:58       ` Junio C Hamano
2012-07-13 22:43     ` Stefano Lattarini
2012-07-13 23:31       ` Junio C Hamano

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.