{"thread":{"id":"27623","subject":"[PATCH] gitweb: allow space as delimiter in mime.types","startedAt":"2011-06-14T14:09:55Z","lastAt":"2011-06-15T06:10:08Z","messageCount":5,"participants":["Ludwig Nussel","Jakub Narebski","J.H.","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"170004","messageId":"1308060595-28294-1-git-send-email-ludwig.nussel@suse.de","threadId":"27623","inReplyTo":null,"subject":"[PATCH] gitweb: allow space as delimiter in mime.types","fromName":"Ludwig Nussel","fromEmail":"ludwig.nussel@suse.de","sentAt":"2011-06-14T14:09:55Z","receivedAt":"2011-06-14T14:09:55Z","isPatch":true,"sender":{"key":"ludwig.nussel@suse.de","avatar":null},"body":"in openSUSE /etc/mime.types has only spaces. I don't know if there's\na canonical reference that says that only tabs are allowed. Mutt at\nleast also accepts spaces. So make gitweb more liberal too.\n---\n gitweb/gitweb.perl |    9 +++------\n 1 files changed, 3 insertions(+), 6 deletions(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex 1b83a8d..d81d87b 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -3560,12 +3560,9 @@ sub mimetype_guess_file {\n \topen(my $mh, '<', $mimemap) or return undef;\n \twhile (<$mh>) {\n \t\tnext if m/^#/; # skip comments\n-\t\tmy ($mimetype, $exts) = split(/\\t+/);\n-\t\tif (defined $exts) {\n-\t\t\tmy @exts = split(/\\s+/, $exts);\n-\t\t\tforeach my $ext (@exts) {\n-\t\t\t\t$mimemap{$ext} = $mimetype;\n-\t\t\t}\n+\t\tmy ($mimetype, @exts) = split(/\\s+/);\n+\t\tforeach my $ext (@exts) {\n+\t\t\t$mimemap{$ext} = $mimetype;\n \t\t}\n \t}\n \tclose($mh);\n-- \n1.7.3.4\n"},{"id":"170011","messageId":"m3ips8v4s2.fsf@localhost.localdomain","threadId":"27623","inReplyTo":"1308060595-28294-1-git-send-email-ludwig.nussel@suse.de","subject":"Re: [PATCH] gitweb: allow space as delimiter in mime.types","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2011-06-14T14:59:10Z","receivedAt":"2011-06-14T14:59:10Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Ludwig Nussel <ludwig.nussel@suse.de> writes:\n\n> Subject: [PATCH] gitweb: allow space as delimiter in mime.types\n\nA very minor nitpick: perhaps \"work with\" rather than \"allow\" would be\nbetter?\n\n> in openSUSE /etc/mime.types has only spaces. I don't know if there's\n> a canonical reference that says that only tabs are allowed. Mutt at\n> least also accepts spaces. So make gitweb more liberal too.\n\nAck.\n\nIt is obviously correct, as names of MUME types cannot contain spaces,\nit makes gitweb work with openSUSE /etc/mime.types, and it makes code\nsimpler.\n\n> ---\n\nSignoff (i.e. Signed-off-by)?\n\n>  gitweb/gitweb.perl |    9 +++------\n>  1 files changed, 3 insertions(+), 6 deletions(-)\n> \n> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\n> index 1b83a8d..d81d87b 100755\n> --- a/gitweb/gitweb.perl\n> +++ b/gitweb/gitweb.perl\n> @@ -3560,12 +3560,9 @@ sub mimetype_guess_file {\n>  \topen(my $mh, '<', $mimemap) or return undef;\n>  \twhile (<$mh>) {\n>  \t\tnext if m/^#/; # skip comments\n> -\t\tmy ($mimetype, $exts) = split(/\\t+/);\n> -\t\tif (defined $exts) {\n> -\t\t\tmy @exts = split(/\\s+/, $exts);\n> -\t\t\tforeach my $ext (@exts) {\n> -\t\t\t\t$mimemap{$ext} = $mimetype;\n> -\t\t\t}\n> +\t\tmy ($mimetype, @exts) = split(/\\s+/);\n> +\t\tforeach my $ext (@exts) {\n> +\t\t\t$mimemap{$ext} = $mimetype;\n>  \t\t}\n>  \t}\n>  \tclose($mh);\n> -- \n> 1.7.3.4\n> \n\n-- \nJakub Narebski\nPoland\nShadeHawk on #git\n"},{"id":"170024","messageId":"4DF7B6EC.6010504@eaglescrag.net","threadId":"27623","inReplyTo":"m3ips8v4s2.fsf@localhost.localdomain","subject":"Re: [PATCH] gitweb: allow space as delimiter in mime.types","fromName":"J.H.","fromEmail":"warthog9@eaglescrag.net","sentAt":"2011-06-14T19:30:52Z","receivedAt":"2011-06-14T19:30:52Z","isPatch":true,"sender":{"key":"warthog9@kernel.org","avatar":"https://avatars.githubusercontent.com/u/2334704?v=4"},"body":"On 06/14/2011 07:59 AM, Jakub Narebski wrote:\n> Ludwig Nussel <ludwig.nussel@suse.de> writes:\n> \n>> Subject: [PATCH] gitweb: allow space as delimiter in mime.types\n> \n> A very minor nitpick: perhaps \"work with\" rather than \"allow\" would be\n> better?\n> \n>> in openSUSE /etc/mime.types has only spaces. I don't know if there's\n>> a canonical reference that says that only tabs are allowed. Mutt at\n>> least also accepts spaces. So make gitweb more liberal too.\n> \n> Ack.\n> \n> It is obviously correct, as names of MUME types cannot contain spaces,\n> it makes gitweb work with openSUSE /etc/mime.types, and it makes code\n> simpler.\n\nI agree with Jakub, Ack.\n\n- John 'Warthog9' Hawley\n"},{"id":"170034","messageId":"7v62o8ksq5.fsf@alter.siamese.dyndns.org","threadId":"27623","inReplyTo":"m3ips8v4s2.fsf@localhost.localdomain","subject":"Re: [PATCH] gitweb: allow space as delimiter in mime.types","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-06-14T21:28:50Z","receivedAt":"2011-06-14T21:28:50Z","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> Ludwig Nussel <ludwig.nussel@suse.de> writes:\n>\n>> Subject: [PATCH] gitweb: allow space as delimiter in mime.types\n>\n> A very minor nitpick: perhaps \"work with\" rather than \"allow\" would be\n> better?\n\nAllow is good; we earlier didn't allow space to be treated as delimiter,\nwith this patch we will do.\n\n>> in openSUSE /etc/mime.types has only spaces. I don't know if there's\n>> a canonical reference that says that only tabs are allowed. Mutt at\n>> least also accepts spaces. So make gitweb more liberal too.\n>\n> Ack.\n>\n> It is obviously correct, as names of MUME types cannot contain spaces,\n> it makes gitweb work with openSUSE /etc/mime.types, and it makes code\n> simpler.\n>\n>> ---\n>\n> Signoff (i.e. Signed-off-by)?\n\nYes, sign-off is missing and necessary.\n\nThanks.\n"},{"id":"170041","messageId":"1308118208-30845-1-git-send-email-ludwig.nussel@suse.de","threadId":"27623","inReplyTo":"7v62o8ksq5.fsf@alter.siamese.dyndns.org","subject":"[PATCH v2] gitweb: allow space as delimiter in mime.types","fromName":"Ludwig Nussel","fromEmail":"ludwig.nussel@suse.de","sentAt":"2011-06-15T06:10:08Z","receivedAt":"2011-06-15T06:10:08Z","isPatch":true,"sender":{"key":"ludwig.nussel@suse.de","avatar":null},"body":"in openSUSE /etc/mime.types has only spaces. I don't know if there's\na canonical reference that says that only tabs are allowed. Mutt at\nleast also accepts spaces. So make gitweb more liberal too.\n\nSigned-off-by: Ludwig Nussel <ludwig.nussel@suse.de>\n---\n gitweb/gitweb.perl |    9 +++------\n 1 files changed, 3 insertions(+), 6 deletions(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex 1b83a8d..d81d87b 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -3560,12 +3560,9 @@ sub mimetype_guess_file {\n \topen(my $mh, '<', $mimemap) or return undef;\n \twhile (<$mh>) {\n \t\tnext if m/^#/; # skip comments\n-\t\tmy ($mimetype, $exts) = split(/\\t+/);\n-\t\tif (defined $exts) {\n-\t\t\tmy @exts = split(/\\s+/, $exts);\n-\t\t\tforeach my $ext (@exts) {\n-\t\t\t\t$mimemap{$ext} = $mimetype;\n-\t\t\t}\n+\t\tmy ($mimetype, @exts) = split(/\\s+/);\n+\t\tforeach my $ext (@exts) {\n+\t\t\t$mimemap{$ext} = $mimetype;\n \t\t}\n \t}\n \tclose($mh);\n-- \n1.7.3.4\n"}]}