{"thread":{"id":"5587","subject":"gitweb on OpenBSD (-T not supported on filesystems...)","startedAt":"2006-09-17T08:45:05Z","lastAt":"2006-09-17T15:07:03Z","messageCount":5,"participants":["Andrew Pamment","Jakub Narebski","Randal L. Schwartz"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"27050","messageId":"op.tf0k9fdvqpav6l@crystal.sienna.ath.cx","threadId":"5587","inReplyTo":null,"subject":"gitweb on OpenBSD (-T not supported on filesystems...)","fromName":"Andrew Pamment","fromEmail":"andrew@mort-os.com","sentAt":"2006-09-17T08:45:05Z","receivedAt":"2006-09-17T08:45:05Z","isPatch":false,"sender":{"key":"andrew@mort-os.com","avatar":null},"body":"Hi git people\n\nI'm not sure if this is useful but I thought I would post it anyway,\n\nin gitweb.cgi on line 1560 where you have -T testing a file descripter, it  \ndoesn't work on OpenBSD 3.9, which makes viewing blobs not work.\n\nI solved this (or I think I have) by replacing $fd with $filename.\n\nAndrew\n\n-- \nMort - http://www.mort-os.com/\n"},{"id":"27058","messageId":"eej3g3$d9j$1@sea.gmane.org","threadId":"5587","inReplyTo":"op.tf0k9fdvqpav6l@crystal.sienna.ath.cx","subject":"Re: gitweb on OpenBSD (-T not supported on filesystems...)","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-09-17T09:12:12Z","receivedAt":"2006-09-17T09:12:12Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Andrew Pamment wrote:\n\n> I'm not sure if this is useful but I thought I would post it anyway,\n> \n> in gitweb.cgi on line 1560 where you have -T testing a file descripter, it  \n> doesn't work on OpenBSD 3.9, which makes viewing blobs not work.\n> \n> I solved this (or I think I have) by replacing $fd with $filename.\n\nThis doesn't work. $filename is file name relative to the git repository,\ni.e. full path would be $projectroot/$project/../$file_name _if_ the\nrepository is full repository and not bare repository, and when projects\nare symlinked .. goes up linked directory.\n\nWe need '-T $fd', where $fd is open pipe from git-cat-file, to avoid\ncreating temporary files (we just removed need for $tmp_dir and temporary\nfiles for creating diffs).\n\n\nWhat Perl version do you use? Does 'perldoc -f -X' has the following lines?\n\n        -X FILEHANDLE\n\n        (...) If \"-T\" or \"-B\" is used on a filehandle, the current IO buffer\n        is examined rather than the first block. (...)\n\nThe solution for you would be to skip -T test.\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"},{"id":"27059","messageId":"op.tf0n3bjjqpav6l@crystal.sienna.ath.cx","threadId":"5587","inReplyTo":"eej3g3$d9j$1@sea.gmane.org","subject":"Re: gitweb on OpenBSD (-T not supported on filesystems...)","fromName":"Andrew Pamment","fromEmail":"andrew@mort-os.com","sentAt":"2006-09-17T09:46:13Z","receivedAt":"2006-09-17T09:46:13Z","isPatch":false,"sender":{"key":"andrew@mort-os.com","avatar":null},"body":"On Sun, 17 Sep 2006 18:42:12 +0930, Jakub Narebski <jnareb@gmail.com>  \nwrote:\n\n> What Perl version do you use? Does 'perldoc -f -X' has the following  \n> lines?\n>\n>         -X FILEHANDLE\n>\n>         (...) If \"-T\" or \"-B\" is used on a filehandle, the current IO  \n> buffer\n>         is examined rather than the first block. (...)\n\nThe version of perl is the one that comes with OpenBSD 3.9, it is v5.8.6.\n\nI do get the above text when I run 'perldoc -f -X', does this mean it  \nshould work? When I try the original -T $fd I get:\n\nSoftware error:\n-T and -B not implemented on filehandles at /var/www/htdocs/git/gitweb.cgi  \nline 1598.\n\n> The solution for you would be to skip -T test.\n\nThat works fine. Thanks.\n\nAndrew\n\n-- \nMort - http://www.mort-os.com/\n"},{"id":"27061","messageId":"eej5qa$i3o$1@sea.gmane.org","threadId":"5587","inReplyTo":"op.tf0n3bjjqpav6l@crystal.sienna.ath.cx","subject":"Re: gitweb on OpenBSD (-T not supported on filesystems...)","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-09-17T09:51:48Z","receivedAt":"2006-09-17T09:51:48Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Andrew Pamment wrote:\n\n> On Sun, 17 Sep 2006 18:42:12 +0930, Jakub Narebski <jnareb@gmail.com>  \n> wrote:\n> \n>> What Perl version do you use? Does 'perldoc -f -X' has the following  \n>> lines?\n>>\n>>         -X FILEHANDLE\n>>\n>>         (...) If \"-T\" or \"-B\" is used on a filehandle, the current IO  \n>> buffer\n>>         is examined rather than the first block. (...)\n> \n> The version of perl is the one that comes with OpenBSD 3.9, it is v5.8.6.\n> \n> I do get the above text when I run 'perldoc -f -X', does this mean it  \n> should work? \n\nI thought that OpenBSD has perhaps distributed some old Perl version that\ndoesn't have -X tests (including -T/-B) on filehandles.\n\n> When I try the original -T $fd I get: \n> \n> Software error:\n> -T and -B not implemented on filehandles at /var/www/htdocs/git/gitweb.cgi  \n> line 1598.\n\nSo this means that Perl implementation in OpenBSD is flawed.\n\nDoes anyone else has problem with gitweb on other systems? (I guess that\ngitweb doesn't work with ActivePerl).\n\n>> The solution for you would be to skip -T test.\n> \n> That works fine. Thanks.\n\nThe -T test is just a fallback for when we cannot derive mimetype. I don't\nknow if you should default to 'application/octet-stream' or 'text/plain' in\nyour case; that perhaps depends on the repository.\n\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"},{"id":"27079","messageId":"864pv6sfag.fsf@blue.stonehenge.com","threadId":"5587","inReplyTo":"eej5qa$i3o$1@sea.gmane.org","subject":"Re: gitweb on OpenBSD (-T not supported on filesystems...)","fromName":"Randal L. Schwartz","fromEmail":"merlyn@stonehenge.com","sentAt":"2006-09-17T15:07:03Z","receivedAt":"2006-09-17T15:07:03Z","isPatch":false,"sender":{"key":"merlyn@stonehenge.com","avatar":"https://gravatar.com/avatar/dc528d210743ff0333e6213f9ee7b33b23f1b7bc1f3c5a8c2d819074ecd7ab19?d=mp&s=160"},"body":">>>>> \"Jakub\" == Jakub Narebski <jnareb@gmail.com> writes:\n\nJakub> I thought that OpenBSD has perhaps distributed some old Perl version that\nJakub> doesn't have -X tests (including -T/-B) on filehandles.\n\n>> When I try the original -T $fd I get: \n>> \n>> Software error:\n>> -T and -B not implemented on filehandles at /var/www/htdocs/git/gitweb.cgi  \n>> line 1598.\n\nJakub> So this means that Perl implementation in OpenBSD is flawed.\n\nNo, see \"perldoc perldiag\":\n\n       \"-T\" and \"-B\" not implemented on filehandles\n           (F) Perl can't peek at the stdio buffer of filehandles when it\n           doesn't know about your kind of stdio.  You'll have to use a file-\n           name instead.\n\nSo the problem is that OpenBSD has a stdio that is not what the Perl authors\nanticipated, because it requires peeking behind official interfaces.  Perl\nisn't flawed. :)\n\n-- \nRandal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095\n<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>\nPerl/Unix/security consulting, Technical writing, Comedy, etc. etc.\nSee PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!\n"}]}