{"thread":{"id":"42256","subject":"t6044 broken on pu","startedAt":"2016-05-07T12:00:08Z","lastAt":"2016-05-10T02:41:51Z","messageCount":20,"participants":["Torsten Bögershausen","Andreas Schwab","Ramsay Jones","Junio C Hamano","demerphq","Jeff King","Eric Sunshine"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"285813","messageId":"7d747193-7ba1-e274-86dc-427ed0f124c9@web.de","threadId":"42256","inReplyTo":null,"subject":"t6044 broken on pu","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2016-05-07T12:00:08Z","receivedAt":"2016-05-07T12:00:08Z","isPatch":false,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"The \"seq\" is not understood by all shells,\nusing printf fixes this,\n\nindex 20a3ffe..48d964e 100755\n--- a/t/t6044-merge-unrelated-index-changes.sh\n+++ b/t/t6044-merge-unrelated-index-changes.sh\n@@ -20,7 +20,7 @@ test_description=\"merges with unrelated index changes\"\n #   Commit E: renames a->subdir/a, adds subdir/e\n\n test_expect_success 'setup trivial merges' '\n-       seq 1 10 >a &&\n+       printf 1 2 3 4 5 7 8 9 10 >a &&\n        git add a &&\n        test_tick && git commit -m A &&\n\n@@ -42,7 +42,7 @@ test_expect_success 'setup trivial merges' '\n        test_tick && git commit -m C &&\n\n        git checkout D &&\n-       seq 2 10 >a &&\n+       printf 2 3 4 5 7 8 9 10 >a &&\n"},{"id":"285815","messageId":"878tzmrrfg.fsf@linux-m68k.org","threadId":"42256","inReplyTo":"7d747193-7ba1-e274-86dc-427ed0f124c9@web.de","subject":"Re: t6044 broken on pu","fromName":"Andreas Schwab","fromEmail":"schwab@linux-m68k.org","sentAt":"2016-05-07T12:19:47Z","receivedAt":"2016-05-07T12:19:47Z","isPatch":false,"sender":{"key":"schwab@linux-m68k.org","avatar":"https://avatars.githubusercontent.com/u/2175493?v=4"},"body":"Torsten Bögershausen <tboegi@web.de> writes:\n\n> The \"seq\" is not understood by all shells,\n> using printf fixes this,\n>\n> index 20a3ffe..48d964e 100755\n> --- a/t/t6044-merge-unrelated-index-changes.sh\n> +++ b/t/t6044-merge-unrelated-index-changes.sh\n> @@ -20,7 +20,7 @@ test_description=\"merges with unrelated index changes\"\n>  #   Commit E: renames a->subdir/a, adds subdir/e\n>\n>  test_expect_success 'setup trivial merges' '\n> -       seq 1 10 >a &&\n> +       printf 1 2 3 4 5 7 8 9 10 >a &&\n\n$ printf 1 2 3 4 5 7 8 9 10\n1\n\nAndreas.\n\n-- \nAndreas Schwab, schwab@linux-m68k.org\nGPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5\n\"And now for something completely different.\"\n"},{"id":"285817","messageId":"572DEA81.4050605@ramsayjones.plus.com","threadId":"42256","inReplyTo":"878tzmrrfg.fsf@linux-m68k.org","subject":"Re: t6044 broken on pu","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsayjones.plus.com","sentAt":"2016-05-07T13:15:45Z","receivedAt":"2016-05-07T13:15:45Z","isPatch":false,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\n\nOn 07/05/16 13:19, Andreas Schwab wrote:\n> Torsten Bögershausen <tboegi@web.de> writes:\n> \n>> The \"seq\" is not understood by all shells,\n>> using printf fixes this,\n>>\n>> index 20a3ffe..48d964e 100755\n>> --- a/t/t6044-merge-unrelated-index-changes.sh\n>> +++ b/t/t6044-merge-unrelated-index-changes.sh\n>> @@ -20,7 +20,7 @@ test_description=\"merges with unrelated index changes\"\n>>  #   Commit E: renames a->subdir/a, adds subdir/e\n>>\n>>  test_expect_success 'setup trivial merges' '\n>> -       seq 1 10 >a &&\n>> +       printf 1 2 3 4 5 7 8 9 10 >a &&\n> \n> $ printf 1 2 3 4 5 7 8 9 10\n> 1\n\nyep, I think:\n\n    printf \"%d\\n\" 1 2 3 4 5 6 7 8 9 10 >a &&\n\nwould be equivalent.\n\nATB,\nRamsay Jones\n"},{"id":"285819","messageId":"572DF117.8060400@ramsayjones.plus.com","threadId":"42256","inReplyTo":"572DEA81.4050605@ramsayjones.plus.com","subject":"Re: t6044 broken on pu","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsayjones.plus.com","sentAt":"2016-05-07T13:43:51Z","receivedAt":"2016-05-07T13:43:51Z","isPatch":false,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\n\nOn 07/05/16 14:15, Ramsay Jones wrote:\n> \n> \n> On 07/05/16 13:19, Andreas Schwab wrote:\n>> Torsten Bögershausen <tboegi@web.de> writes:\n>>\n>>> The \"seq\" is not understood by all shells,\n>>> using printf fixes this,\n>>>\n>>> index 20a3ffe..48d964e 100755\n>>> --- a/t/t6044-merge-unrelated-index-changes.sh\n>>> +++ b/t/t6044-merge-unrelated-index-changes.sh\n>>> @@ -20,7 +20,7 @@ test_description=\"merges with unrelated index changes\"\n>>>  #   Commit E: renames a->subdir/a, adds subdir/e\n>>>\n>>>  test_expect_success 'setup trivial merges' '\n>>> -       seq 1 10 >a &&\n>>> +       printf 1 2 3 4 5 7 8 9 10 >a &&\n>>\n>> $ printf 1 2 3 4 5 7 8 9 10\n>> 1\n> \n> yep, I think:\n> \n>     printf \"%d\\n\" 1 2 3 4 5 6 7 8 9 10 >a &&\n> \n> would be equivalent.\n> \n\nHaving said that, there is also 'test_seq' which you can use\nto avoid portability problems (although it uses perl, so could\nbe viewed as a bit heavyweight):\n\n    test_seq 1 10 >a &&\n\nATB,\nRamsay Jones\n"},{"id":"285824","messageId":"d1fcc54b-ddd7-b03b-79fa-2112a3f43141@web.de","threadId":"42256","inReplyTo":"878tzmrrfg.fsf@linux-m68k.org","subject":"Re: t6044 broken on pu","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2016-05-07T16:18:30Z","receivedAt":"2016-05-07T16:18:30Z","isPatch":false,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"On 2016-05-07 14.19, Andreas Schwab wrote:\n> Torsten Bögershausen <tboegi@web.de> writes:\n> \n>> The \"seq\" is not understood by all shells,\n>> using printf fixes this,\n>>\n>> index 20a3ffe..48d964e 100755\n>> --- a/t/t6044-merge-unrelated-index-changes.sh\n>> +++ b/t/t6044-merge-unrelated-index-changes.sh\n>> @@ -20,7 +20,7 @@ test_description=\"merges with unrelated index changes\"\n>>  #   Commit E: renames a->subdir/a, adds subdir/e\n>>\n>>  test_expect_success 'setup trivial merges' '\n>> -       seq 1 10 >a &&\n>> +       printf 1 2 3 4 5 7 8 9 10 >a &&\n> \n> $ printf 1 2 3 4 5 7 8 9 10\n> 1\n\nThat's true, but the test passes anyway.\nSo do we need the sequence ?\nIs there something that can be improved in the test ?\n"},{"id":"285829","messageId":"xmqqa8k11e8j.fsf@gitster.mtv.corp.google.com","threadId":"42256","inReplyTo":"d1fcc54b-ddd7-b03b-79fa-2112a3f43141@web.de","subject":"Re: t6044 broken on pu","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-05-08T02:21:32Z","receivedAt":"2016-05-08T02:21:32Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Torsten Bögershausen <tboegi@web.de> writes:\n\n> That's true, but the test passes anyway.\n\nYou can also remove the body of the test and replace it with \"true\"\nand say \"the test passes anyway\".  Changing the test to use a file\nwith only one line is irresponsible, if you do not know the nature\nof expected future bug that requires 10 lines to be there to\nmanifest that the test wants to try.\n\ntest_seq was invented exactly for the purpose of accomodating\nplatforms that lack seq, so using it would probably be the best\nfirst step.  Updating implementation of test_seq to avoid $PERL\nwould be a separate step, if desired (I personally do not think\nthat is worth it).\n"},{"id":"285833","messageId":"5618208c-ce45-d65c-abf8-498cfe0f2f84@web.de","threadId":"42256","inReplyTo":"xmqqa8k11e8j.fsf@gitster.mtv.corp.google.com","subject":"Re: t6044 broken on pu","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2016-05-08T06:54:06Z","receivedAt":"2016-05-08T06:54:06Z","isPatch":false,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"On 08.05.16 04:21, Junio C Hamano wrote:\n> Torsten Bögershausen <tboegi@web.de> writes:\n>\n>> That's true, but the test passes anyway.\n> You can also remove the body of the test and replace it with \"true\"\n> and say \"the test passes anyway\".  Changing the test to use a file\n> with only one line is irresponsible, if you do not know the nature\n> of expected future bug that requires 10 lines to be there to\n> manifest that the test wants to try.\n>\n> test_seq was invented exactly for the purpose of accomodating\n> platforms that lack seq, so using it would probably be the best\n> first step.  Updating implementation of test_seq to avoid $PERL\n> would be a separate step, if desired (I personally do not think\n> that is worth it).\nWe don't need to invoke perl, when the shell can do that internally ?\n\nMay a  simple\n printf \"1\\n2\\n3\\n4\\n5\\n6\\n7\\n8\\n9\\n10\\n\"\n\nbe an option ?\n"},{"id":"285893","messageId":"xmqqoa8gza1t.fsf@gitster.mtv.corp.google.com","threadId":"42256","inReplyTo":"5618208c-ce45-d65c-abf8-498cfe0f2f84@web.de","subject":"Re: t6044 broken on pu","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-05-08T18:20:14Z","receivedAt":"2016-05-08T18:20:14Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Torsten Bögershausen <tboegi@web.de> writes:\n\n> May a  simple\n>  printf \"1\\n2\\n3\\n4\\n5\\n6\\n7\\n8\\n9\\n10\\n\"\n>\n> be an option ?\n\nIf you were to do that, at least have the decency to make it more\nreadable by doing something like:\n\n\tprintf \"%s\\n\" 1 2 3 4 5 6 7 8 9 10\n\n;-)\n\nBut as I said, as a response to \"t6044 broken on pu\" bug report,\ns/seq/test_seq/ is the only sensible change.\n\nImproving \"test_seq, the alternative to seq\" is a separate topic.\n\nIf you have aversion to $PERL, perhaps do them without using\nanything what is not expected to be built-in in modern shells,\nperhaps like this?\n\n t/test-lib-functions.sh | 7 ++++++-\n 1 file changed, 6 insertions(+), 1 deletion(-)\n\ndiff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh\nindex 8d99eb3..4edddac 100644\n--- a/t/test-lib-functions.sh\n+++ b/t/test-lib-functions.sh\n@@ -739,7 +739,12 @@ test_seq () {\n \t2)\t;;\n \t*)\terror \"bug in the test script: not 1 or 2 parameters to test_seq\" ;;\n \tesac\n-\tperl -le 'print for $ARGV[0]..$ARGV[1]' -- \"$@\"\n+\ttest_seq_counter__=$1\n+\twhile test \"$test_seq_counter__\" -le $2\n+\tdo\n+\t\techo \"$test_seq_counter__\"\n+\t\ttest_seq_counter__=$((test_seq_counter__ + 1))\n+\tdone\n }\n \n # This function can be used to schedule some commands to be run\n"},{"id":"285904","messageId":"6871653f-248f-ef9a-1947-0ed88783ad8b@web.de","threadId":"42256","inReplyTo":"xmqqoa8gza1t.fsf@gitster.mtv.corp.google.com","subject":"Re: t6044 broken on pu","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2016-05-09T04:43:30Z","receivedAt":"2016-05-09T04:43:30Z","isPatch":false,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"\n\nOn 08.05.16 20:20, Junio C Hamano wrote:\n> Torsten Bögershausen <tboegi@web.de> writes:\n>\n>> May a  simple\n>>  printf \"1\\n2\\n3\\n4\\n5\\n6\\n7\\n8\\n9\\n10\\n\"\n>>\n>> be an option ?\n> If you were to do that, at least have the decency to make it more\n> readable by doing something like:\n>\n> \tprintf \"%s\\n\" 1 2 3 4 5 6 7 8 9 10\n>\n> ;-)\n>\n> But as I said, as a response to \"t6044 broken on pu\" bug report,\n> s/seq/test_seq/ is the only sensible change.\n>\n> Improving \"test_seq, the alternative to seq\" is a separate topic.\n>\n> If you have aversion to $PERL, perhaps do them without using\n> anything what is not expected to be built-in in modern shells,\n> perhaps like this?\nPlease don't get me wrong -\nI wasn't really clear why:\nI think that the invocation of an external program\nto produce a 10 line test program is a waste of CPU cycles  - in this very use case.\n\nWe can try to use the ideal tool to do the job, in this case\nthe fork() that needs to be done to invoke perl seems rather expensive in relation\nto what we get in terms of functionality - a file with 10 lines of content.\n\nI recently read a message why \"grep | sed\" is not ideal, when sed can do everything\nthat grep needs to do, and only 1 external program needs to be invoked - not 2.\n\nI try to apply the same pattern to this TC: Stay in the shell, as long as possible.\nBut if you really need perl for e.g. regexp, then use it.\n"},{"id":"285910","messageId":"CANgJU+V9+-hTFvDxCGbQxFcHMRcFaP-NdS_P93DqXuxi1Lh4mg@mail.gmail.com","threadId":"42256","inReplyTo":"xmqqoa8gza1t.fsf@gitster.mtv.corp.google.com","subject":"Re: t6044 broken on pu","fromName":"demerphq","fromEmail":"demerphq@gmail.com","sentAt":"2016-05-09T06:30:51Z","receivedAt":"2016-05-09T06:30:51Z","isPatch":false,"sender":{"key":"demerphq@gmail.com","avatar":null},"body":"On 8 May 2016 at 20:20, Junio C Hamano <gitster@pobox.com> wrote:\n> Torsten Bögershausen <tboegi@web.de> writes:\n>\n>> May a  simple\n>>  printf \"1\\n2\\n3\\n4\\n5\\n6\\n7\\n8\\n9\\n10\\n\"\n>>\n>> be an option ?\n>\n> If you were to do that, at least have the decency to make it more\n> readable by doing something like:\n>\n>         printf \"%s\\n\" 1 2 3 4 5 6 7 8 9 10\n>\n> ;-)\n>\n> But as I said, as a response to \"t6044 broken on pu\" bug report,\n> s/seq/test_seq/ is the only sensible change.\n>\n> Improving \"test_seq, the alternative to seq\" is a separate topic.\n>\n> If you have aversion to $PERL, perhaps do them without using\n> anything what is not expected to be built-in in modern shells,\n> perhaps like this?\n>\n>  t/test-lib-functions.sh | 7 ++++++-\n>  1 file changed, 6 insertions(+), 1 deletion(-)\n>\n> diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh\n> index 8d99eb3..4edddac 100644\n> --- a/t/test-lib-functions.sh\n> +++ b/t/test-lib-functions.sh\n> @@ -739,7 +739,12 @@ test_seq () {\n>         2)      ;;\n>         *)      error \"bug in the test script: not 1 or 2 parameters to test_seq\" ;;\n>         esac\n> -       perl -le 'print for $ARGV[0]..$ARGV[1]' -- \"$@\"\n> +       test_seq_counter__=$1\n> +       while test \"$test_seq_counter__\" -le $2\n> +       do\n> +               echo \"$test_seq_counter__\"\n> +               test_seq_counter__=$((test_seq_counter__ + 1))\n> +       done\n>  }\n\nIs that perl snippet ever called with non-numeric output?\n\nperl -le 'print for $ARGV[0]..$ARGV[1]' -- A E\nA\nB\nC\nD\nE\n\nYves\n\n\n\n-- \nperl -Mre=debug -e \"/just|another|perl|hacker/\"\n"},{"id":"285916","messageId":"20160509083323.GB14299@sigill.intra.peff.net","threadId":"42256","inReplyTo":"CANgJU+V9+-hTFvDxCGbQxFcHMRcFaP-NdS_P93DqXuxi1Lh4mg@mail.gmail.com","subject":"Re: t6044 broken on pu","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2016-05-09T08:33:23Z","receivedAt":"2016-05-09T08:33:23Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, May 09, 2016 at 08:30:51AM +0200, demerphq wrote:\n\n> > -       perl -le 'print for $ARGV[0]..$ARGV[1]' -- \"$@\"\n> > +       test_seq_counter__=$1\n> > +       while test \"$test_seq_counter__\" -le $2\n> > +       do\n> > +               echo \"$test_seq_counter__\"\n> > +               test_seq_counter__=$((test_seq_counter__ + 1))\n> > +       done\n> >  }\n> \n> Is that perl snippet ever called with non-numeric output?\n> \n> perl -le 'print for $ARGV[0]..$ARGV[1]' -- A E\n> A\n> B\n> C\n> D\n> E\n\nI had that thought, too, but I think it would be an error to do so.\ntest_seq is supposed to be a replacement for \"seq\", which does not\nunderstand non-numeric sequences.\n\nA quick \"git grep test_seq\" seems to back that up.\n\n-Peff\n"},{"id":"285928","messageId":"CAPig+cTyEU1gEwD5AuODkLzF--EOqo5_MQHD5QEFpb8dgh_wrw@mail.gmail.com","threadId":"42256","inReplyTo":"20160509083323.GB14299@sigill.intra.peff.net","subject":"Re: t6044 broken on pu","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2016-05-09T16:02:45Z","receivedAt":"2016-05-09T16:02:45Z","isPatch":false,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Mon, May 9, 2016 at 4:33 AM, Jeff King <peff@peff.net> wrote:\n> On Mon, May 09, 2016 at 08:30:51AM +0200, demerphq wrote:\n>> > -       perl -le 'print for $ARGV[0]..$ARGV[1]' -- \"$@\"\n>> > +       test_seq_counter__=$1\n>> > +       while test \"$test_seq_counter__\" -le $2\n>> > +       do\n>> > +               echo \"$test_seq_counter__\"\n>> > +               test_seq_counter__=$((test_seq_counter__ + 1))\n>> > +       done\n>> >  }\n>>\n>> Is that perl snippet ever called with non-numeric output?\n>>\n>> perl -le 'print for $ARGV[0]..$ARGV[1]' -- A E\n>> A\n>> B\n>> C\n>> D\n>> E\n>\n> I had that thought, too, but I think it would be an error to do so.\n> test_seq is supposed to be a replacement for \"seq\", which does not\n> understand non-numeric sequences.\n\nAlthough, the comment block just above test_seq() in\ntest-lib-functions.sh says otherwise:\n\n    Print a sequence of numbers or letters in increasing order.  This\n    is similar to GNU seq(1), but the latter might not be available\n    everywhere (and does not do letters).  It may be used like:\n\n    for i in $(test_seq 100)\n    do\n        for j in $(test_seq 10 20)\n        do\n            for k in $(test_seq a z)\n            do\n                echo $i-$j-$k\n            done\n        done\n    done\n"},{"id":"285925","messageId":"20160509161226.GB11861@sigill.intra.peff.net","threadId":"42256","inReplyTo":"CAPig+cTyEU1gEwD5AuODkLzF--EOqo5_MQHD5QEFpb8dgh_wrw@mail.gmail.com","subject":"Re: t6044 broken on pu","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2016-05-09T16:12:27Z","receivedAt":"2016-05-09T16:12:27Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, May 09, 2016 at 12:02:45PM -0400, Eric Sunshine wrote:\n\n> > I had that thought, too, but I think it would be an error to do so.\n> > test_seq is supposed to be a replacement for \"seq\", which does not\n> > understand non-numeric sequences.\n> \n> Although, the comment block just above test_seq() in\n> test-lib-functions.sh says otherwise:\n> \n>     Print a sequence of numbers or letters in increasing order.  This\n>     is similar to GNU seq(1), but the latter might not be available\n>     everywhere (and does not do letters).  It may be used like:\n> \n>     for i in $(test_seq 100)\n>     do\n>         for j in $(test_seq 10 20)\n>         do\n>             for k in $(test_seq a z)\n>             do\n>                 echo $i-$j-$k\n>             done\n>         done\n>     done\n\nOh, indeed. I apparently even Acked that documentation once upon a time. :-/\n\nAnyway, I double-checked my earlier \"grep\" and I do not think anybody is\nusing that functionality. So I think we'd be OK to change it as long as\nwe updated the documentation to match.\n\nI don't really care either way whether it is replaced or not (at one\npoint there were some people really interested in NO_PERL not even using\none-liners in the test suite, but I am not one of them).\n\n-Peff\n"},{"id":"285956","messageId":"xmqqvb2num4w.fsf@gitster.mtv.corp.google.com","threadId":"42256","inReplyTo":"6871653f-248f-ef9a-1947-0ed88783ad8b@web.de","subject":"Re: t6044 broken on pu","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-05-09T18:22:39Z","receivedAt":"2016-05-09T18:22:39Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Torsten Bögershausen <tboegi@web.de> writes:\n\n> On 08.05.16 20:20, Junio C Hamano wrote:\n>> Torsten Bögershausen <tboegi@web.de> writes:\n>>\n>>> May a  simple\n>>>  printf \"1\\n2\\n3\\n4\\n5\\n6\\n7\\n8\\n9\\n10\\n\"\n>>>\n>>> be an option ?\n>> If you were to do that, at least have the decency to make it more\n>> readable by doing something like:\n>>\n>> \tprintf \"%s\\n\" 1 2 3 4 5 6 7 8 9 10\n>>\n>> ;-)\n>>\n>> But as I said, as a response to \"t6044 broken on pu\" bug report,\n>> s/seq/test_seq/ is the only sensible change.\n>>\n>> Improving \"test_seq, the alternative to seq\" is a separate topic.\n>>\n>> If you have aversion to $PERL, perhaps do them without using\n>> anything what is not expected to be built-in in modern shells,\n>> perhaps like this?\n> Please don't get me wrong -\n\nI don't.\n\n> I wasn't really clear why:\n\nSo is it now clear?\n\nThe title of the bug report is \"t6044 broken on pu\". The analysis of\nthe issue is \"We use 'test_seq 1 10' when we want one to ten on each\nline in the output to use in test to make sure it is portable, but a\nnew commit forgot the portability issue and used seq instead\".\n\nThe only sensible fix is \"Use test_seq like everybody else\".\n\nImproving the implementation of test_seq is a totally separate\nissue.  It may be a good thing to do independently to save external\nprogram, and the effect of such change will not be limited to t6044\nbut all other existing users of test_seq.\n\nAnd that is why it must be done as a separate topic.\n\nWhy you think it is a good idea to update t6044 with printf\n\"1\\n2\\n3\\n4\\n5\\n6\\n7\\n8\\n9\\n10\\n\" is beyond me--don't you want to\nmake sure that existing users of test_seq benefits the same way?\n"},{"id":"285957","messageId":"xmqqr3dbulyp.fsf@gitster.mtv.corp.google.com","threadId":"42256","inReplyTo":"20160509161226.GB11861@sigill.intra.peff.net","subject":"Re: t6044 broken on pu","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-05-09T18:26:22Z","receivedAt":"2016-05-09T18:26:22Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> On Mon, May 09, 2016 at 12:02:45PM -0400, Eric Sunshine wrote:\n>\n>> > I had that thought, too, but I think it would be an error to do so.\n>> > test_seq is supposed to be a replacement for \"seq\", which does not\n>> > understand non-numeric sequences.\n>> \n>> Although, the comment block just above test_seq() in\n>> test-lib-functions.sh says otherwise:\n>> \n>>     Print a sequence of numbers or letters in increasing order.  This\n>>     is similar to GNU seq(1), but the latter might not be available\n>>     everywhere (and does not do letters).  It may be used like:\n>> \n>>     for i in $(test_seq 100)\n>>     do\n>>         for j in $(test_seq 10 20)\n>>         do\n>>             for k in $(test_seq a z)\n>>             do\n>>                 echo $i-$j-$k\n>>             done\n>>         done\n>>     done\n>\n> Oh, indeed. I apparently even Acked that documentation once upon a time. :-/\n>\n> Anyway, I double-checked my earlier \"grep\" and I do not think anybody is\n> using that functionality. So I think we'd be OK to change it as long as\n> we updated the documentation to match.\n\nYes, I think the comment should just go.  Nobody used that alphabet\nform since it was written in d17cf5f3 (tests: Introduce test_seq,\n2012-08-04).\n\n> I don't really care either way whether it is replaced or not (at one\n> point there were some people really interested in NO_PERL not even using\n> one-liners in the test suite, but I am not one of them).\n\nNeither am I, but I think it is prudent to drop that \"letters\".  The\ncomment even says the letter form is not portable already, so the\nmention of GNU seq(1) is not helping at all.\n"},{"id":"285958","messageId":"xmqqh9e7ulie.fsf@gitster.mtv.corp.google.com","threadId":"42256","inReplyTo":"xmqqr3dbulyp.fsf@gitster.mtv.corp.google.com","subject":"Re: t6044 broken on pu","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-05-09T18:36:09Z","receivedAt":"2016-05-09T18:36:09Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Yes, I think the comment should just go.  Nobody used that alphabet\n> form since it was written in d17cf5f3 (tests: Introduce test_seq,\n> 2012-08-04).\n>\n>> I don't really care either way whether it is replaced or not (at one\n>> point there were some people really interested in NO_PERL not even using\n>> one-liners in the test suite, but I am not one of them).\n>\n> Neither am I, but I think it is prudent to drop that \"letters\".  The\n> comment even says the letter form is not portable already, so the\n> mention of GNU seq(1) is not helping at all.\n\n-- >8 --\nSubject: test-lib-functions.sh: remove misleading comment on test_seq\n\nWe never used the \"letters\" form since we came up with \"test_seq\" to\nreplace use of non-portable \"seq\" in our test script, which we\nintroduced it at d17cf5f3 (tests: Introduce test_seq, 2012-08-04).\n\nWe use this helper to either iterate for N times (i.e. the values on\nthe lines do not even matter), or just to get N distinct strings\n(i.e. the values on the lines themselves do not really matter, but\nwe care that they are different from each other and reproducible).\n\nStop promising that we may allow using \"letters\"; this would open an\neasier reimplementation that does not rely on $PERL, if somebody\nlater wants to.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n t/test-lib-functions.sh | 21 +++++++--------------\n 1 file changed, 7 insertions(+), 14 deletions(-)\n\ndiff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh\nindex 8d99eb3..cc9f61d 100644\n--- a/t/test-lib-functions.sh\n+++ b/t/test-lib-functions.sh\n@@ -718,20 +718,13 @@ test_cmp_rev () {\n \ttest_cmp expect.rev actual.rev\n }\n \n-# Print a sequence of numbers or letters in increasing order.  This is\n-# similar to GNU seq(1), but the latter might not be available\n-# everywhere (and does not do letters).  It may be used like:\n-#\n-#\tfor i in $(test_seq 100)\n-#\tdo\n-#\t\tfor j in $(test_seq 10 20)\n-#\t\tdo\n-#\t\t\tfor k in $(test_seq a z)\n-#\t\t\tdo\n-#\t\t\t\techo $i-$j-$k\n-#\t\t\tdone\n-#\t\tdone\n-#\tdone\n+# Print a sequence of integers in increasing order, either with\n+# two arguments (start and end):\n+#\n+#     test_seq 1 5 -- outputs 1 2 3 4 5 one line at a time\n+#\n+# or with one argument (end), in which case it starts counting \n+# from 1.\n \n test_seq () {\n \tcase $# in\n"},{"id":"285967","messageId":"CAPig+cSg7e=aV4YmJ2iioo6GHB7ZeNREKC-20X47F=5MbzDQLA@mail.gmail.com","threadId":"42256","inReplyTo":"xmqqh9e7ulie.fsf@gitster.mtv.corp.google.com","subject":"Re: t6044 broken on pu","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2016-05-09T20:10:47Z","receivedAt":"2016-05-09T20:10:47Z","isPatch":false,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Mon, May 9, 2016 at 2:36 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> Subject: test-lib-functions.sh: remove misleading comment on test_seq\n>\n> We never used the \"letters\" form since we came up with \"test_seq\" to\n> replace use of non-portable \"seq\" in our test script, which we\n> introduced it at d17cf5f3 (tests: Introduce test_seq, 2012-08-04).\n>\n> We use this helper to either iterate for N times (i.e. the values on\n> the lines do not even matter), or just to get N distinct strings\n> (i.e. the values on the lines themselves do not really matter, but\n> we care that they are different from each other and reproducible).\n>\n> Stop promising that we may allow using \"letters\"; this would open an\n> easier reimplementation that does not rely on $PERL, if somebody\n> later wants to.\n>\n> Signed-off-by: Junio C Hamano <gitster@pobox.com>\n> ---\n> diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh\n> @@ -718,20 +718,13 @@ test_cmp_rev () {\n> -# Print a sequence of numbers or letters in increasing order.  This is\n> -# similar to GNU seq(1), but the latter might not be available\n> -# everywhere (and does not do letters).  It may be used like:\n> -#\n> -#      for i in $(test_seq 100)\n> -#      do\n> -#              for j in $(test_seq 10 20)\n> -#              do\n> -#                      for k in $(test_seq a z)\n> -#                      do\n> -#                              echo $i-$j-$k\n> -#                      done\n> -#              done\n> -#      done\n> +# Print a sequence of integers in increasing order, either with\n> +# two arguments (start and end):\n> +#\n> +#     test_seq 1 5 -- outputs 1 2 3 4 5 one line at a time\n> +#\n> +# or with one argument (end), in which case it starts counting\n> +# from 1.\n\nThis new documentation is quite readable. Thanks.\n\n>  test_seq () {\n>         case $# in\n"},{"id":"285993","messageId":"xmqqeg9bszw0.fsf@gitster.mtv.corp.google.com","threadId":"42256","inReplyTo":"xmqqh9e7ulie.fsf@gitster.mtv.corp.google.com","subject":"Re: t6044 broken on pu","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-05-09T21:08:31Z","receivedAt":"2016-05-09T21:08:31Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Stop promising that we may allow using \"letters\"; this would open an\n> easier reimplementation that does not rely on $PERL, if somebody\n> later wants to.\n>\n> Signed-off-by: Junio C Hamano <gitster@pobox.com>\n\nAnd I am not the one who particularly wants to, but here is the\nprevious patch sent elsewhere in the thread.\n\n-- >8 --\nSubject: [PATCH] test-lib-functions.sh: rewrite test_seq without Perl\n\nRewrite the 'seq' imitation only with commands and features\nthat are typically found as built-in in modern POSIX shells,\ninstead of relying on Perl to run a single-liner.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n t/test-lib-functions.sh | 7 ++++++-\n 1 file changed, 6 insertions(+), 1 deletion(-)\n\ndiff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh\nindex 39b8151..9734e32 100644\n--- a/t/test-lib-functions.sh\n+++ b/t/test-lib-functions.sh\n@@ -679,7 +679,12 @@ test_seq () {\n \t2)\t;;\n \t*)\terror \"bug in the test script: not 1 or 2 parameters to test_seq\" ;;\n \tesac\n-\tperl -le 'print for $ARGV[0]..$ARGV[1]' -- \"$@\"\n+\ttest_seq_counter__=$1\n+\twhile test \"$test_seq_counter__\" -le \"$2\"\n+\tdo\n+\t\techo \"$test_seq_counter__\"\n+\t\ttest_seq_counter__=$(( $test_seq_counter__ + 1 ))\n+\tdone\n }\n \n # This function can be used to schedule some commands to be run\n-- \n2.8.2-557-gee41d5e\n"},{"id":"285994","messageId":"CAPig+cQopZta6bs8JBV23iP4xpaPk2Y4UZ5E6rWeTEtYxW=uJA@mail.gmail.com","threadId":"42256","inReplyTo":"xmqqeg9bszw0.fsf@gitster.mtv.corp.google.com","subject":"Re: t6044 broken on pu","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2016-05-09T21:27:54Z","receivedAt":"2016-05-09T21:27:54Z","isPatch":false,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Mon, May 9, 2016 at 5:08 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> Subject: [PATCH] test-lib-functions.sh: rewrite test_seq without Perl\n>\n> Rewrite the 'seq' imitation only with commands and features\n> that are typically found as built-in in modern POSIX shells,\n> instead of relying on Perl to run a single-liner.\n>\n> Signed-off-by: Junio C Hamano <gitster@pobox.com>\n> ---\n> diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh\n> @@ -679,7 +679,12 @@ test_seq () {\n>         2)      ;;\n>         *)      error \"bug in the test script: not 1 or 2 parameters to test_seq\" ;;\n>         esac\n> -       perl -le 'print for $ARGV[0]..$ARGV[1]' -- \"$@\"\n> +       test_seq_counter__=$1\n> +       while test \"$test_seq_counter__\" -le \"$2\"\n> +       do\n> +               echo \"$test_seq_counter__\"\n> +               test_seq_counter__=$(( $test_seq_counter__ + 1 ))\n> +       done\n>  }\n\nLooks (obviously) correct and works as expected on Mac and BSD.\n"},{"id":"286007","messageId":"20160510024151.GB16965@sigill.intra.peff.net","threadId":"42256","inReplyTo":"xmqqh9e7ulie.fsf@gitster.mtv.corp.google.com","subject":"Re: t6044 broken on pu","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2016-05-10T02:41:51Z","receivedAt":"2016-05-10T02:41:51Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, May 09, 2016 at 11:36:09AM -0700, Junio C Hamano wrote:\n\n> Junio C Hamano <gitster@pobox.com> writes:\n> \n> > Yes, I think the comment should just go.  Nobody used that alphabet\n> > form since it was written in d17cf5f3 (tests: Introduce test_seq,\n> > 2012-08-04).\n> >\n> >> I don't really care either way whether it is replaced or not (at one\n> >> point there were some people really interested in NO_PERL not even using\n> >> one-liners in the test suite, but I am not one of them).\n> >\n> > Neither am I, but I think it is prudent to drop that \"letters\".  The\n> > comment even says the letter form is not portable already, so the\n> > mention of GNU seq(1) is not helping at all.\n> \n> -- >8 --\n> Subject: test-lib-functions.sh: remove misleading comment on test_seq\n\nThanks, this (and the actual implementation change) both look good to\nme, and I'm happy with either or both being applied.\n\n-Peff\n"}]}