{"thread":{"id":"48740","subject":"t5562: gzip -k is not portable","startedAt":"2018-06-19T17:25:33Z","lastAt":"2018-06-20T15:41:44Z","messageCount":10,"participants":["Torsten Bögershausen","Junio C Hamano","Eric Sunshine","Jeff King","Rodrigo Campos"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"350502","messageId":"5ee7a65d-63e1-aa6a-c3c1-663c092d0efe@web.de","threadId":"48740","inReplyTo":null,"subject":"t5562: gzip -k is not portable","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2018-06-19T17:25:15Z","receivedAt":"2018-06-19T17:25:33Z","isPatch":false,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"Hej Max,\n\nt5562 fails here under MacOS:\n\"gzip -k\"  is not portable.\n\nThe following works (there may be better solutions, I didn't dig into \nthe test code)\n\ndiff --git a/t/t5562-http-backend-content-length.sh \nb/t/t5562-http-backend-content-length.sh\nindex 8040d80e04..7befe3885c 100755\n--- a/t/t5562-http-backend-content-length.sh\n+++ b/t/t5562-http-backend-content-length.sh\n@@ -61,9 +61,13 @@ test_expect_success 'setup' '\n  '\n\n  test_expect_success GZIP 'setup, compression related' '\n-       gzip -k fetch_body &&\n+       cp fetch_body f &&\n+       gzip fetch_body &&\n+       mv f fetch_body &&\n         test_copy_bytes 10 <fetch_body.gz >fetch_body.gz.trunc &&\n-       gzip -k push_body &&\n+       cp push_body f &&\n+       gzip push_body &&\n+       mv f push_body &&\n         test_copy_bytes 10 <push_body.gz >push_body.gz.trunc\n\n"},{"id":"350516","messageId":"xmqqk1quvegh.fsf@gitster-ct.c.googlers.com","threadId":"48740","inReplyTo":"5ee7a65d-63e1-aa6a-c3c1-663c092d0efe@web.de","subject":"Re: t5562: gzip -k is not portable","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-06-19T18:06:06Z","receivedAt":"2018-06-19T18:06:11Z","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> Hej Max,\n>\n> t5562 fails here under MacOS:\n> \"gzip -k\"  is not portable.\n\nSigh.  Perhaps -c would help.  Or do BSD implementations also lack -c?\n\n t/t5562-http-backend-content-length.sh | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/t/t5562-http-backend-content-length.sh b/t/t5562-http-backend-content-length.sh\nindex 8040d80e04..98b6543827 100755\n--- a/t/t5562-http-backend-content-length.sh\n+++ b/t/t5562-http-backend-content-length.sh\n@@ -61,9 +61,9 @@ test_expect_success 'setup' '\n '\n \n test_expect_success GZIP 'setup, compression related' '\n-\tgzip -k fetch_body &&\n+\tgzip -c fetch_body >fetch_body.gz &&\n \ttest_copy_bytes 10 <fetch_body.gz >fetch_body.gz.trunc &&\n-\tgzip -k push_body &&\n+\tgzip -c push_body >push_body.gz &&\n \ttest_copy_bytes 10 <push_body.gz >push_body.gz.trunc\n '\n \n"},{"id":"350519","messageId":"CAPig+cT2xkR=LbAJLCdeynGkiPysakbVna61cfrtgO3kKh85+g@mail.gmail.com","threadId":"48740","inReplyTo":"xmqqk1quvegh.fsf@gitster-ct.c.googlers.com","subject":"Re: t5562: gzip -k is not portable","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2018-06-19T18:22:40Z","receivedAt":"2018-06-19T18:22:55Z","isPatch":false,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Tue, Jun 19, 2018 at 2:06 PM Junio C Hamano <gitster@pobox.com> wrote:\n> Torsten Bögershausen <tboegi@web.de> writes:\n> > t5562 fails here under MacOS:\n> > \"gzip -k\"  is not portable.\n\nVery odd. Stock /usr/bin/gzip on my MacOS 10.12.6 _does_ recognize -k,\nand the test does pass.\n\n> Sigh.  Perhaps -c would help.  Or do BSD implementations also lack -c?\n\nMacOS and BSD do support -c, so this solution would also work (and is\n\"cleaner\" the the other proposal).\n\n> diff --git a/t/t5562-http-backend-content-length.sh b/t/t5562-http-backend-content-length.sh\n> @@ -61,9 +61,9 @@ test_expect_success 'setup' '\n>  test_expect_success GZIP 'setup, compression related' '\n> -       gzip -k fetch_body &&\n> +       gzip -c fetch_body >fetch_body.gz &&\n>         test_copy_bytes 10 <fetch_body.gz >fetch_body.gz.trunc &&\n> -       gzip -k push_body &&\n> +       gzip -c push_body >push_body.gz &&\n>         test_copy_bytes 10 <push_body.gz >push_body.gz.trunc\n>  '\n"},{"id":"350533","messageId":"117d2657-067a-6fe6-3713-de7a5aa75a11@web.de","threadId":"48740","inReplyTo":"CAPig+cT2xkR=LbAJLCdeynGkiPysakbVna61cfrtgO3kKh85+g@mail.gmail.com","subject":"Re: t5562: gzip -k is not portable","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2018-06-19T20:40:16Z","receivedAt":"2018-06-19T20:40:33Z","isPatch":false,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"\n\nOn 06/19/2018 08:22 PM, Eric Sunshine wrote:\n> On Tue, Jun 19, 2018 at 2:06 PM Junio C Hamano <gitster@pobox.com> wrote:\n>> Torsten Bögershausen <tboegi@web.de> writes:\n>>> t5562 fails here under MacOS:\n>>> \"gzip -k\"  is not portable.\n> Very odd. Stock /usr/bin/gzip on my MacOS 10.12.6 _does_ recognize -k,\n> and the test does pass.\n\nThis is the test box running Mac OS X 10.6 speaking.\nThe -c seems to need even -f.\nBut this doesn't work either:\n\ngzip 1.3.12\nCopyright (C) 2007 Free Software Foundation, Inc.\nCopyright (C) 1993 Jean-loup Gailly.\nThis is free software.  You may redistribute copies of it under the terms of\nthe GNU General Public License <http://www.gnu.org/licenses/gpl.html>.\nThere is NO WARRANTY, to the extent permitted by law.\n\nWritten by Jean-loup Gailly.\nprerequisite GZIP ok\nexpecting success:\n     gzip -f -c fetch_body >fetch_body.gz &&\n     test_copy_bytes 10 <fetch_body.gz >fetch_body.gz.trunc &&\n     gzip -f -c push_body >push_body,gz &&\n     test_copy_bytes 10 <push_body.gz >push_body.gz.trunc\n\n./test-lib.sh: line 632: push_body.gz: No such file or directory\nnot ok 2 - setup, compression related\n#\n#        gzip -f -c fetch_body >fetch_body.gz &&\n#        test_copy_bytes 10 <fetch_body.gz >fetch_body.gz.trunc &&\n#        gzip -f -c push_body >push_body,gz &&\n#        test_copy_bytes 10 <push_body.gz >push_body.gz.trunc\n#\n\n\n>> Sigh.  Perhaps -c would help.  Or do BSD implementations also lack -c?\n> MacOS and BSD do support -c, so this solution would also work (and is\n> \"cleaner\" the the other proposal).\n>\n>> diff --git a/t/t5562-http-backend-content-length.sh b/t/t5562-http-backend-content-length.sh\n>> @@ -61,9 +61,9 @@ test_expect_success 'setup' '\n>>   test_expect_success GZIP 'setup, compression related' '\n>> -       gzip -k fetch_body &&\n>> +       gzip -c fetch_body >fetch_body.gz &&\n>>          test_copy_bytes 10 <fetch_body.gz >fetch_body.gz.trunc &&\n>> -       gzip -k push_body &&\n>> +       gzip -c push_body >push_body.gz &&\n>>          test_copy_bytes 10 <push_body.gz >push_body.gz.trunc\n>>   '\n\n"},{"id":"350535","messageId":"20180619205310.GA30710@sigill.intra.peff.net","threadId":"48740","inReplyTo":"117d2657-067a-6fe6-3713-de7a5aa75a11@web.de","subject":"Re: t5562: gzip -k is not portable","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2018-06-19T20:53:10Z","receivedAt":"2018-06-19T20:53:15Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Jun 19, 2018 at 10:40:16PM +0200, Torsten Bögershausen wrote:\n\n> \n> \n> On 06/19/2018 08:22 PM, Eric Sunshine wrote:\n> > On Tue, Jun 19, 2018 at 2:06 PM Junio C Hamano <gitster@pobox.com> wrote:\n> > > Torsten Bögershausen <tboegi@web.de> writes:\n> > > > t5562 fails here under MacOS:\n> > > > \"gzip -k\"  is not portable.\n> > Very odd. Stock /usr/bin/gzip on my MacOS 10.12.6 _does_ recognize -k,\n> > and the test does pass.\n> \n> This is the test box running Mac OS X 10.6 speaking.\n> The -c seems to need even -f.\n> But this doesn't work either:\n> \n> gzip 1.3.12\n> Copyright (C) 2007 Free Software Foundation, Inc.\n> Copyright (C) 1993 Jean-loup Gailly.\n> This is free software.  You may redistribute copies of it under the terms of\n> the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.\n> There is NO WARRANTY, to the extent permitted by law.\n\nAh, that's it. \"-k\" came about in gzip v1.6. That's 5 years old, but\nobviously some people are still running it.\n\n\"-c\" goes back quite a while and should be safe, I think.\n\n> expecting success:\n>     gzip -f -c fetch_body >fetch_body.gz &&\n>     test_copy_bytes 10 <fetch_body.gz >fetch_body.gz.trunc &&\n>     gzip -f -c push_body >push_body,gz &&\n>     test_copy_bytes 10 <push_body.gz >push_body.gz.trunc\n> \n> ./test-lib.sh: line 632: push_body.gz: No such file or directory\n\nTypo in the \">\" redirect (comma instead of period)?\n\n-Peff\n"},{"id":"350536","messageId":"20180619205304.m37wkgl3ojuzmwo6@sdfg.com.ar","threadId":"48740","inReplyTo":"117d2657-067a-6fe6-3713-de7a5aa75a11@web.de","subject":"Re: t5562: gzip -k is not portable","fromName":"Rodrigo Campos","fromEmail":"rodrigo@sdfg.com.ar","sentAt":"2018-06-19T20:53:04Z","receivedAt":"2018-06-19T20:55:07Z","isPatch":false,"sender":{"key":"rodrigo@sdfg.com.ar","avatar":null},"body":"On Tue, Jun 19, 2018 at 10:40:16PM +0200, Torsten Bögershausen wrote:\n> \n> \n> On 06/19/2018 08:22 PM, Eric Sunshine wrote:\n> > On Tue, Jun 19, 2018 at 2:06 PM Junio C Hamano <gitster@pobox.com> wrote:\n> > > Torsten Bögershausen <tboegi@web.de> writes:\n> > > > t5562 fails here under MacOS:\n> > > > \"gzip -k\"  is not portable.\n> > Very odd. Stock /usr/bin/gzip on my MacOS 10.12.6 _does_ recognize -k,\n> > and the test does pass.\n> \n> gzip 1.3.12\n\nOh, this seems to be the issue. As I've said in my prvious email, the first\nversion to include this was 1.6 IIRC.\n\nThe commit adding it is here[1]. But yeah, it was not added 20 years ago, and it\nseems there are systems with such old versions of gzip (although can probably\nupdate? Don't know much about mac) :-(\n\n\n[1]: http://git.savannah.gnu.org/cgit/gzip.git/commit/?id=0192f02e26ac9fa0a27ed177263ee3ea73d5e95c\n"},{"id":"350537","messageId":"20180619204824.oahvg7bxyqxnrqp3@sdfg.com.ar","threadId":"48740","inReplyTo":"5ee7a65d-63e1-aa6a-c3c1-663c092d0efe@web.de","subject":"Re: t5562: gzip -k is not portable","fromName":"Rodrigo Campos","fromEmail":"rodrigo@sdfg.com.ar","sentAt":"2018-06-19T20:48:24Z","receivedAt":"2018-06-19T20:55:45Z","isPatch":false,"sender":{"key":"rodrigo@sdfg.com.ar","avatar":null},"body":"On Tue, Jun 19, 2018 at 07:25:15PM +0200, Torsten Bögershausen wrote:\n> Hej Max,\n> \n> t5562 fails here under MacOS:\n> \"gzip -k\"  is not portable.\n\nWhat do you mean with is not portable?\n\nI wrote the patch for gzip[1]. That was in 2013, and is included since version\n1.6 IIUC:\n\n\t$ git tag --contains 0192f02e26ac9fa0a27ed177263ee3ea73d5e95c\n\tv1.6\n\tv1.7\n\tv1.8\n\tv1.9\n\nBut that maybe is too new? Or do you mean something else?\n\n[1]: http://git.savannah.gnu.org/cgit/gzip.git/commit/?id=0192f02e26ac9fa0a27ed177263ee3ea73d5e95c\n"},{"id":"350551","messageId":"20180620061306.GA7813@tor.lan","threadId":"48740","inReplyTo":"20180619205310.GA30710@sigill.intra.peff.net","subject":"Re: t5562: gzip -k is not portable","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2018-06-20T06:13:06Z","receivedAt":"2018-06-20T06:13:26Z","isPatch":false,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"On Tue, Jun 19, 2018 at 04:53:10PM -0400, Jeff King wrote:\n> On Tue, Jun 19, 2018 at 10:40:16PM +0200, Torsten Bögershausen wrote:\n> \n> > \n> > \n> > On 06/19/2018 08:22 PM, Eric Sunshine wrote:\n> > > On Tue, Jun 19, 2018 at 2:06 PM Junio C Hamano <gitster@pobox.com> wrote:\n> > > > Torsten Bögershausen <tboegi@web.de> writes:\n> > > > > t5562 fails here under MacOS:\n> > > > > \"gzip -k\"  is not portable.\n> > > Very odd. Stock /usr/bin/gzip on my MacOS 10.12.6 _does_ recognize -k,\n> > > and the test does pass.\n> > \n> > This is the test box running Mac OS X 10.6 speaking.\n> > The -c seems to need even -f.\n> > But this doesn't work either:\n> > \n> > gzip 1.3.12\n> > Copyright (C) 2007 Free Software Foundation, Inc.\n> > Copyright (C) 1993 Jean-loup Gailly.\n> > This is free software.  You may redistribute copies of it under the terms of\n> > the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.\n> > There is NO WARRANTY, to the extent permitted by law.\n> \n> Ah, that's it. \"-k\" came about in gzip v1.6. That's 5 years old, but\n> obviously some people are still running it.\n> \n> \"-c\" goes back quite a while and should be safe, I think.\n> \n> > expecting success:\n> >     gzip -f -c fetch_body >fetch_body.gz &&\n> >     test_copy_bytes 10 <fetch_body.gz >fetch_body.gz.trunc &&\n> >     gzip -f -c push_body >push_body,gz &&\n> >     test_copy_bytes 10 <push_body.gz >push_body.gz.trunc\n> > \n> > ./test-lib.sh: line 632: push_body.gz: No such file or directory\n> \n> Typo in the \">\" redirect (comma instead of period)?\n> \n> -Peff\n\nGood eyes, thanks.\nThe \"-f -c\" combo works:\n\n-       gzip -k fetch_body &&\n+       gzip -f -c fetch_body >fetch_body.gz &&\n        test_copy_bytes 10 <fetch_body.gz >fetch_body.gz.trunc &&\n-       gzip -k push_body &&\n+       gzip -f -c push_body >push_body.gz &&\n"},{"id":"350560","messageId":"20180620124006.GB7932@sigill.intra.peff.net","threadId":"48740","inReplyTo":"20180620061306.GA7813@tor.lan","subject":"Re: t5562: gzip -k is not portable","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2018-06-20T12:40:06Z","receivedAt":"2018-06-20T12:40:11Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Jun 20, 2018 at 08:13:06AM +0200, Torsten Bögershausen wrote:\n\n> Good eyes, thanks.\n> The \"-f -c\" combo works:\n> \n> -       gzip -k fetch_body &&\n> +       gzip -f -c fetch_body >fetch_body.gz &&\n>         test_copy_bytes 10 <fetch_body.gz >fetch_body.gz.trunc &&\n> -       gzip -k push_body &&\n> +       gzip -f -c push_body >push_body.gz &&\n\nDo we still need \"-f\"?  With \"-c\" gzip is only writing to stdout, so we\nshould not need to force anything.\n\n-Peff\n"},{"id":"350568","messageId":"20180620154123.GB19382@tor.lan","threadId":"48740","inReplyTo":"20180620124006.GB7932@sigill.intra.peff.net","subject":"Re: t5562: gzip -k is not portable","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2018-06-20T15:41:23Z","receivedAt":"2018-06-20T15:41:44Z","isPatch":false,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"On Wed, Jun 20, 2018 at 08:40:06AM -0400, Jeff King wrote:\n> On Wed, Jun 20, 2018 at 08:13:06AM +0200, Torsten Bögershausen wrote:\n> \n> > Good eyes, thanks.\n> > The \"-f -c\" combo works:\n> > \n> > -       gzip -k fetch_body &&\n> > +       gzip -f -c fetch_body >fetch_body.gz &&\n> >         test_copy_bytes 10 <fetch_body.gz >fetch_body.gz.trunc &&\n> > -       gzip -k push_body &&\n> > +       gzip -f -c push_body >push_body.gz &&\n> \n> Do we still need \"-f\"?  With \"-c\" gzip is only writing to stdout, so we\n> should not need to force anything.\n> \n> -Peff\n\nYou are rigth, -f is not needed.\n\nI was confusing stdout with terminal :-( \nMost often stdout is the terminal, but not here of course.\n"}]}