{"thread":{"id":"27048","subject":"[PATCH] supply '-n' to gzip to produce identical tarballs","startedAt":"2011-04-10T06:12:16Z","lastAt":"2011-04-11T20:59:36Z","messageCount":6,"participants":["Fraser Tweedale","Jakub Narebski","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"165531","messageId":"1302415936-7362-1-git-send-email-frase@frase.id.au","threadId":"27048","inReplyTo":null,"subject":"[PATCH] supply '-n' to gzip to produce identical tarballs","fromName":"Fraser Tweedale","fromEmail":"frase@frase.id.au","sentAt":"2011-04-10T06:12:16Z","receivedAt":"2011-04-10T06:12:16Z","isPatch":true,"sender":{"key":"frase@frase.id.au","avatar":"https://avatars.githubusercontent.com/u/2331938?v=4"},"body":"Without the '-n' ('--no-name') argument, gzip includes timestamp in\noutput which results in different files.  Important systems like FreeBSD\nports and perhaps many others hash/checksum downloaded files to ensure\nintegrity.  For projects that do not release official archives, gitweb's\nsnapshot feature would be an excellent stand-in but for the fact that the\nfiles it produces are not identical.\n\nSupply '-n' to gzip to exclude timestamp from output and produce idential\noutput every time.\n\nSigned-off-by: Fraser Tweedale <frase@frase.id.au>\n---\n gitweb/gitweb.perl |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex 46186ab..2ab08da 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -186,7 +186,7 @@ our %known_snapshot_formats = (\n \t\t'type' => 'application/x-gzip',\n \t\t'suffix' => '.tar.gz',\n \t\t'format' => 'tar',\n-\t\t'compressor' => ['gzip']},\n+\t\t'compressor' => ['gzip', '-n']},\n \n \t'tbz2' => {\n \t\t'display' => 'tar.bz2',\n-- \n1.7.4.3\n"},{"id":"165534","messageId":"m362qm4kvu.fsf@localhost.localdomain","threadId":"27048","inReplyTo":"1302415936-7362-1-git-send-email-frase@frase.id.au","subject":"Re: [PATCH] supply '-n' to gzip to produce identical tarballs","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2011-04-10T07:38:32Z","receivedAt":"2011-04-10T07:38:32Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Fraser Tweedale <frase@frase.id.au> writes:\n\n> Subject: [PATCH] supply '-n' to gzip to produce identical tarballs\n>\n> Without the '-n' ('--no-name') argument, gzip includes timestamp in\n> output which results in different files.  Important systems like FreeBSD\n> ports and perhaps many others hash/checksum downloaded files to ensure\n> integrity.  For projects that do not release official archives, gitweb's\n> snapshot feature would be an excellent stand-in but for the fact that the\n> files it produces are not identical.\n> \n> Supply '-n' to gzip to exclude timestamp from output and produce idential\n> output every time.\n> \n> Signed-off-by: Fraser Tweedale <frase@frase.id.au>\n\nVery good description, except subject line should denote which\nsubsystem this commit affects, i.e.:\n\n  gitweb: supply '-n' to gzip to produce identical tarballs\n\nHmmm... gzip in gitweb's 'snapshot' action gets data compressed from\nstandard input, not from filesystem.  Isn't -n / --no-name no-op then?\nJust asking...\n\n> ---\n>  gitweb/gitweb.perl |    2 +-\n>  1 files changed, 1 insertions(+), 1 deletions(-)\n> \n> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\n> index 46186ab..2ab08da 100755\n> --- a/gitweb/gitweb.perl\n> +++ b/gitweb/gitweb.perl\n> @@ -186,7 +186,7 @@ our %known_snapshot_formats = (\n>  \t\t'type' => 'application/x-gzip',\n>  \t\t'suffix' => '.tar.gz',\n>  \t\t'format' => 'tar',\n> -\t\t'compressor' => ['gzip']},\n> +\t\t'compressor' => ['gzip', '-n']},\n\nPerhaps it would be more clear to use\n\n  +\t\t'compressor' => ['gzip', '--no-name']},\n\n>  \n>  \t'tbz2' => {\n>  \t\t'display' => 'tar.bz2',\n> -- \n> 1.7.4.3\n> \n\n-- \nJakub Narebski\nPoland\nShadeHawk on #git\n"},{"id":"165542","messageId":"20110410101345.GD1521@bacardi.wooloowin.frase.id.au","threadId":"27048","inReplyTo":"m362qm4kvu.fsf@localhost.localdomain","subject":"Re: [PATCH] supply '-n' to gzip to produce identical tarballs","fromName":"Fraser Tweedale","fromEmail":"frase@frase.id.au","sentAt":"2011-04-10T10:13:46Z","receivedAt":"2011-04-10T10:13:46Z","isPatch":true,"sender":{"key":"frase@frase.id.au","avatar":"https://avatars.githubusercontent.com/u/2331938?v=4"},"body":"On Sun, Apr 10, 2011 at 12:38:32AM -0700, Jakub Narebski wrote:\n> Fraser Tweedale <frase@frase.id.au> writes:\n> \n> > Subject: [PATCH] supply '-n' to gzip to produce identical tarballs\n> >\n> > Without the '-n' ('--no-name') argument, gzip includes timestamp in\n> > output which results in different files.  Important systems like FreeBSD\n> > ports and perhaps many others hash/checksum downloaded files to ensure\n> > integrity.  For projects that do not release official archives, gitweb's\n> > snapshot feature would be an excellent stand-in but for the fact that the\n> > files it produces are not identical.\n> > \n> > Supply '-n' to gzip to exclude timestamp from output and produce idential\n> > output every time.\n> > \n> > Signed-off-by: Fraser Tweedale <frase@frase.id.au>\n> \n> Very good description, except subject line should denote which\n> subsystem this commit affects, i.e.:\n> \n>   gitweb: supply '-n' to gzip to produce identical tarballs\n> \nThank you.  Do I need to amend the message and resubmit the patch?  (first\ntime submitting a patch to git; I used git send-email).\n\n> Hmmm... gzip in gitweb's 'snapshot' action gets data compressed from\n> standard input, not from filesystem.  Isn't -n / --no-name no-op then?\n> Just asking...\n> \nIt is not no-op; I have tested to confirm this.  I'm not sure whether\na file name is recorded in the stdin case, or if so what it is, but the\ntimestamp is recorded and that makes the difference.\n\n> > ---\n> >  gitweb/gitweb.perl |    2 +-\n> >  1 files changed, 1 insertions(+), 1 deletions(-)\n> > \n> > diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\n> > index 46186ab..2ab08da 100755\n> > --- a/gitweb/gitweb.perl\n> > +++ b/gitweb/gitweb.perl\n> > @@ -186,7 +186,7 @@ our %known_snapshot_formats = (\n> >  \t\t'type' => 'application/x-gzip',\n> >  \t\t'suffix' => '.tar.gz',\n> >  \t\t'format' => 'tar',\n> > -\t\t'compressor' => ['gzip']},\n> > +\t\t'compressor' => ['gzip', '-n']},\n> \n> Perhaps it would be more clear to use\n> \n>   +\t\t'compressor' => ['gzip', '--no-name']},\n> \n> >  \n> >  \t'tbz2' => {\n> >  \t\t'display' => 'tar.bz2',\n> > -- \n> > 1.7.4.3\n> > \n> \nDefinitely, if the argument is the same (or even present) on all systems.\nOn FreeBSD and GNU both '-n' and '--no-name' are do the job, but an audit\nof other systems should be done to ensure they don't break.  I chose '-n'\nas it seemed the more conservative choice.\n\n> -- \n> Jakub Narebski\n> Poland\n> ShadeHawk on #git\n"},{"id":"165545","messageId":"201104101555.09798.jnareb@gmail.com","threadId":"27048","inReplyTo":"20110410101345.GD1521@bacardi.wooloowin.frase.id.au","subject":"Re: [PATCH] supply '-n' to gzip to produce identical tarballs","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2011-04-10T13:55:06Z","receivedAt":"2011-04-10T13:55:06Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"On Sun, 10 Apr 2011, Fraser Tweedale wrote:\n> On Sun, Apr 10, 2011 at 12:38:32AM -0700, Jakub Narebski wrote:\n> > Fraser Tweedale <frase@frase.id.au> writes:\n> > \n> > > Subject: [PATCH] supply '-n' to gzip to produce identical tarballs\n \n> > Very good description, except subject line should denote which\n> > subsystem this commit affects, i.e.:\n> > \n> >   gitweb: supply '-n' to gzip to produce identical tarballs\n>  \n> Thank you.  Do I need to amend the message and resubmit the patch?  (first\n> time submitting a patch to git; I used git send-email).\n\nI don't think so.  I guess that Junio can do such trivial amend when\napplying, at the time he is adding his signoff.\n\n> > Hmmm... gzip in gitweb's 'snapshot' action gets data compressed from\n> > standard input, not from filesystem.  Isn't -n / --no-name no-op then?\n> > Just asking...\n> \n> It is not no-op; I have tested to confirm this.  I'm not sure whether\n> a file name is recorded in the stdin case, or if so what it is, but the\n> timestamp is recorded and that makes the difference.\n\nThanks for the clarification.\n\nFor what it is worth:\n\nAcked-by: Jakub Narebski <jnareb@gmail.com>\n\n\n> > > -\t\t'compressor' => ['gzip']},\n> > > +\t\t'compressor' => ['gzip', '-n']},\n> > \n> > Perhaps it would be more clear to use\n> > \n> >   +\t\t'compressor' => ['gzip', '--no-name']},\n\n> Definitely, if the argument is the same (or even present) on all systems.\n> On FreeBSD and GNU both '-n' and '--no-name' are do the job, but an audit\n> of other systems should be done to ensure they don't break.  I chose '-n'\n> as it seemed the more conservative choice.\n\nSo you choose '-n' because it has more chance of being widely supported,\nisn't it?  Good enough for me.\n\n-- \nJakub Narebski\nPoland\n"},{"id":"165643","messageId":"7vei58wq0a.fsf@alter.siamese.dyndns.org","threadId":"27048","inReplyTo":"201104101555.09798.jnareb@gmail.com","subject":"Re: [PATCH] supply '-n' to gzip to produce identical tarballs","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-04-11T19:24:05Z","receivedAt":"2011-04-11T19:24:05Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jakub Narebski <jnareb@gmail.com> writes:\n\n>> > Perhaps it would be more clear to use\n>> > \n>> >   +\t\t'compressor' => ['gzip', '--no-name']},\n>\n>> Definitely, if the argument is the same (or even present) on all systems.\n>> On FreeBSD and GNU both '-n' and '--no-name' are do the job, but an audit\n>> of other systems should be done to ensure they don't break.  I chose '-n'\n>> as it seemed the more conservative choice.\n>\n> So you choose '-n' because it has more chance of being widely supported,\n> isn't it?  Good enough for me.\n\nInteresting.  \"gzip <COPYING\" does get a consistent result because it can\nfstat to get the timestamp, but \"cat COPYING | gzip\" does change its\noutput every time it is run.  Good catch and a solution.  Thanks, both.\n\nSo I should expect a pull request sometime after 1.7.5 final from you,\nwith \"an audit of other systems\" done by others on the list noted in the\nfinal commit message?\n"},{"id":"165648","messageId":"20110411205934.GI1521@bacardi.wooloowin.frase.id.au","threadId":"27048","inReplyTo":"7vei58wq0a.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] supply '-n' to gzip to produce identical tarballs","fromName":"Fraser Tweedale","fromEmail":"frase@frase.id.au","sentAt":"2011-04-11T20:59:36Z","receivedAt":"2011-04-11T20:59:36Z","isPatch":true,"sender":{"key":"frase@frase.id.au","avatar":"https://avatars.githubusercontent.com/u/2331938?v=4"},"body":"On Mon, Apr 11, 2011 at 12:24:05PM -0700, Junio C Hamano wrote:\n> Jakub Narebski <jnareb@gmail.com> writes:\n> \n> >> > Perhaps it would be more clear to use\n> >> > \n> >> >   +\t\t'compressor' => ['gzip', '--no-name']},\n> >\n> >> Definitely, if the argument is the same (or even present) on all systems.\n> >> On FreeBSD and GNU both '-n' and '--no-name' are do the job, but an audit\n> >> of other systems should be done to ensure they don't break.  I chose '-n'\n> >> as it seemed the more conservative choice.\n> >\n> > So you choose '-n' because it has more chance of being widely supported,\n> > isn't it?  Good enough for me.\n> \n> Interesting.  \"gzip <COPYING\" does get a consistent result because it can\n> fstat to get the timestamp, but \"cat COPYING | gzip\" does change its\n> output every time it is run.  Good catch and a solution.  Thanks, both.\n> \n> So I should expect a pull request sometime after 1.7.5 final from you,\n> with \"an audit of other systems\" done by others on the list noted in the\n> final commit message?\n> \n> \nSure, no problem.\n\nThanks,\n\nFraser\n"}]}