threads / patch / 7809

patchFix tail option problem in test

Subject: [PATCH] Fix tail option problem in test

## tl;dr

4 messages between Apr 23, 2007 and Apr 24, 2007. Diffs are folded; open one to read it.

replies: 3people: 2as markdown or json

A Large Angry SCM· Apr 23, 2007, 23:56 UTC · lore
The tail command on my system complains:
	tail: cannot open `8192' for reading: No such file or directory
if there is any whitespace between the '-c' option and the byte count.
Signed-off-by: A Large Angry SCM <Gitzilla@gmail.com>
---
 t/t5302-pack-index.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Show changes to t/t5302-pack-index.sh +1 −1
diff --git a/t/t5302-pack-index.sh b/t/t5302-pack-index.sh
index 232e5f1..b7870a8 100755
--- a/t/t5302-pack-index.sh
+++ b/t/t5302-pack-index.sh
@@ -16,7 +16,7 @@ test_expect_success \
          test-genrandom "$i" 8192 >>file_$i &&
          git-update-index --add file_$i || return 1
      done &&
-     echo 101 >file_101 && tail -c 8192 file_100 >>file_101 &&
+     echo 101 >file_101 && tail -c8192 file_100 >>file_101 &&
      git-update-index --add file_101 &&
      tree=`git-write-tree` &&
      commit=`git-commit-tree $tree </dev/null` && {
Junio C Hamano· Apr 24, 2007, 00:09 UTC · re: A Large Angry SCM · lore

Re: [PATCH] Fix tail option problem in test

A Large Angry SCM <gitzilla@gmail.com> writes:
Show 25 quoted lines
> The tail command on my system complains:
>
> 	tail: cannot open `8192' for reading: No such file or directory
>
> if there is any whitespace between the '-c' option and the byte count.
>
> Signed-off-by: A Large Angry SCM <Gitzilla@gmail.com>
> ---
>
>  t/t5302-pack-index.sh |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/t/t5302-pack-index.sh b/t/t5302-pack-index.sh
> index 232e5f1..b7870a8 100755
> --- a/t/t5302-pack-index.sh
> +++ b/t/t5302-pack-index.sh
> @@ -16,7 +16,7 @@ test_expect_success \
>           test-genrandom "$i" 8192 >>file_$i &&
>           git-update-index --add file_$i || return 1
>       done &&
> -     echo 101 >file_101 && tail -c 8192 file_100 >>file_101 &&
> +     echo 101 >file_101 && tail -c8192 file_100 >>file_101 &&
>       git-update-index --add file_101 &&
>       tree=`git-write-tree` &&
>       commit=`git-commit-tree $tree </dev/null` && {

I do not like using tail to do a byte-oriented thing like this to begin with. How about using the plain old trustworthy and portable program, "dd", instead?

A Large Angry SCM· Apr 24, 2007, 00:29 UTC · re: Junio C Hamano · lore

Re: [PATCH] Fix tail option problem in test

Junio C Hamano wrote:
Show 31 quoted lines
> A Large Angry SCM <gitzilla@gmail.com> writes:
> 
>> The tail command on my system complains:
>>
>> 	tail: cannot open `8192' for reading: No such file or directory
>>
>> if there is any whitespace between the '-c' option and the byte count.
>>
>> Signed-off-by: A Large Angry SCM <Gitzilla@gmail.com>
>> ---
>>
>>  t/t5302-pack-index.sh |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/t/t5302-pack-index.sh b/t/t5302-pack-index.sh
>> index 232e5f1..b7870a8 100755
>> --- a/t/t5302-pack-index.sh
>> +++ b/t/t5302-pack-index.sh
>> @@ -16,7 +16,7 @@ test_expect_success \
>>           test-genrandom "$i" 8192 >>file_$i &&
>>           git-update-index --add file_$i || return 1
>>       done &&
>> -     echo 101 >file_101 && tail -c 8192 file_100 >>file_101 &&
>> +     echo 101 >file_101 && tail -c8192 file_100 >>file_101 &&
>>       git-update-index --add file_101 &&
>>       tree=`git-write-tree` &&
>>       commit=`git-commit-tree $tree </dev/null` && {
> 
> I do not like using tail to do a byte-oriented thing like this
> to begin with.  How about using the plain old trustworthy and
> portable program, "dd", instead?
It's not as easy to get the last X bytes of a file with dd.

← back to recent threads