{"thread":{"id":"26328","subject":"[PATCH] Fix wrong xhtml option to highlight","startedAt":"2011-01-24T19:44:58Z","lastAt":"2011-01-28T12:35:40Z","messageCount":5,"participants":["Jochen Schmitt","Junio C Hamano","Drew Northup","Jakub Narebski"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"159825","messageId":"1295898298-9794-1-git-send-email-Jochen@herr-schmitt.de","threadId":"26328","inReplyTo":null,"subject":"[PATCH] Fix wrong xhtml option to highlight","fromName":"Jochen Schmitt","fromEmail":"jochen@herr-schmitt.de","sentAt":"2011-01-24T19:44:58Z","receivedAt":"2011-01-24T19:44:58Z","isPatch":true,"sender":{"key":"jochen@herr-schmitt.de","avatar":null},"body":"---\nHallo,\n\nbecause I'm the maintainer of the highlight package in the\nFedora Project I was notified, that highlight doesn't works\nproperly with gitweb in BZ #672293.\n\nSo I have create the following simple patch to solve the \nreported issue.\n\nBest Regards\n\nJochen Schmitt\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 1025c2f..b662420 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -3468,7 +3468,7 @@ sub run_highlighter {\n \tclose $fd;\n \topen $fd, quote_command(git_cmd(), \"cat-file\", \"blob\", $hash).\" | \".\n \t          quote_command($highlight_bin).\n-\t          \" --xhtml --fragment --syntax $syntax |\"\n+\t          \" -xhtml --fragment --syntax $syntax |\"\n \t\tor die_error(500, \"Couldn't open file or run syntax highlighter\");\n \treturn $fd;\n }\n-- \n1.7.3.4\n"},{"id":"159833","messageId":"7vvd1dlxza.fsf@alter.siamese.dyndns.org","threadId":"26328","inReplyTo":"1295898298-9794-1-git-send-email-Jochen@herr-schmitt.de","subject":"Re: [PATCH] Fix wrong xhtml option to highlight","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-01-24T22:48:25Z","receivedAt":"2011-01-24T22:48:25Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jochen Schmitt <Jochen@herr-schmitt.de> writes:\n\n> ---\n> Hallo,\n>\n> because I'm the maintainer of the highlight package in the\n> Fedora Project I was notified, that highlight doesn't works\n> properly with gitweb in BZ #672293.\n>\n> So I have create the following simple patch to solve the \n> reported issue.\n>\n> Best Regards\n>\n> Jochen Schmitt\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 1025c2f..b662420 100755\n> --- a/gitweb/gitweb.perl\n> +++ b/gitweb/gitweb.perl\n> @@ -3468,7 +3468,7 @@ sub run_highlighter {\n>  \tclose $fd;\n>  \topen $fd, quote_command(git_cmd(), \"cat-file\", \"blob\", $hash).\" | \".\n>  \t          quote_command($highlight_bin).\n> -\t          \" --xhtml --fragment --syntax $syntax |\"\n> +\t          \" -xhtml --fragment --syntax $syntax |\"\n\nCurious.\n\nDoes the command take double-dash for the fragment and syntax options but\na single dash for the xhtml option?  Really...\n\nA few top hits returned by Google for \"highlight manual page\" tells me\notherwise.\n"},{"id":"159938","messageId":"1296092646.23506.10.camel@drew-northup.unet.maine.edu","threadId":"26328","inReplyTo":"7vvd1dlxza.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] Fix wrong xhtml option to highlight","fromName":"Drew Northup","fromEmail":"drew.northup@maine.edu","sentAt":"2011-01-27T01:44:06Z","receivedAt":"2011-01-27T01:44:06Z","isPatch":true,"sender":{"key":"drew.northup@maine.edu","avatar":"https://avatars.githubusercontent.com/u/18331571?v=4"},"body":"\nOn Mon, 2011-01-24 at 14:48 -0800, Junio C Hamano wrote:\n> Jochen Schmitt <Jochen@herr-schmitt.de> writes:\n> \n> > ---\n> > Hallo,\n> >\n> > because I'm the maintainer of the highlight package in the\n> > Fedora Project I was notified, that highlight doesn't works\n> > properly with gitweb in BZ #672293.\n> >\n> > So I have create the following simple patch to solve the \n> > reported issue.\n> >\n> > Best Regards\n> >\n> > Jochen Schmitt\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 1025c2f..b662420 100755\n> > --- a/gitweb/gitweb.perl\n> > +++ b/gitweb/gitweb.perl\n> > @@ -3468,7 +3468,7 @@ sub run_highlighter {\n> >  \tclose $fd;\n> >  \topen $fd, quote_command(git_cmd(), \"cat-file\", \"blob\", $hash).\" | \".\n> >  \t          quote_command($highlight_bin).\n> > -\t          \" --xhtml --fragment --syntax $syntax |\"\n> > +\t          \" -xhtml --fragment --syntax $syntax |\"\n> \n> Curious.\n> \n> Does the command take double-dash for the fragment and syntax options but\n> a single dash for the xhtml option?  Really...\n> \n> A few top hits returned by Google for \"highlight manual page\" tells me\n> otherwise.\n\nCertainly appears to be the case that \"--xhtml\" is the option in Ubuntu\n10.04.1 LTS. \n\nJochen,\nDid you mean \"-X\" (which sets the same option)?\n\n-- \n-Drew Northup\n________________________________________________\n\"As opposed to vegetable or mineral error?\"\n-John Pescatore, SANS NewsBites Vol. 12 Num. 59\n"},{"id":"159952","messageId":"7vvd1agoii.fsf@alter.siamese.dyndns.org","threadId":"26328","inReplyTo":"1296092646.23506.10.camel@drew-northup.unet.maine.edu","subject":"Re: [PATCH] Fix wrong xhtml option to highlight","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-01-27T19:00:53Z","receivedAt":"2011-01-27T19:00:53Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Drew Northup <drew.northup@maine.edu> writes:\n\n>> > diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\n>> > index 1025c2f..b662420 100755\n>> > --- a/gitweb/gitweb.perl\n>> > +++ b/gitweb/gitweb.perl\n>> > @@ -3468,7 +3468,7 @@ sub run_highlighter {\n>> >  \tclose $fd;\n>> >  \topen $fd, quote_command(git_cmd(), \"cat-file\", \"blob\", $hash).\" | \".\n>> >  \t          quote_command($highlight_bin).\n>> > -\t          \" --xhtml --fragment --syntax $syntax |\"\n>> > +\t          \" -xhtml --fragment --syntax $syntax |\"\n>> \n>> Curious.\n>> \n>> Does the command take double-dash for the fragment and syntax options but\n>> a single dash for the xhtml option?  Really...\n>> \n>> A few top hits returned by Google for \"highlight manual page\" tells me\n>> otherwise.\n>\n> Certainly appears to be the case that \"--xhtml\" is the option in Ubuntu\n> 10.04.1 LTS. \n>\n> Jochen,\n> Did you mean \"-X\" (which sets the same option)?\n\nThe current proposal is to drop --xhtml and let highlight default to HTML.\n\nHonestly speaking, I don't like the approach very much; it would have been\nmuch better if highlight had a single way that is supported throughout its\nversions to specify the output format.  But it appears that there isn't,\nand relying on and hoping for its default to stay HTML is the best we\ncould do, if we plan to support highlight 2.4.something or older.\n\nThe copy of U10.04 I have has highlight 2.12, and according to its manual\npages, -X, --xhtml, and --out-format=xhtml mean the same thing.  HTML is\nthe default.\n\nThe change-log at www.andre-simon.de indicates that --out-format has\nbecome the preferred method and the short options like -X and -H are not\nsupported in recent versions (3.0 beta and newer).\n\nBut as Jakub mentioned, 2.4.5 did not have --output-format; it was only in\n3.0 beta that -O was redefined to mean --output-format and in old versions\nthe short option meant something else.\n\nWhat a mess...\n\nThe next time we introduce a new dependency, we really should try hard to\nassess the stability and maturity of that dependency.  In hindsight, I\nthink \"highlight\" was probably a bit too premature to be depended upon.\n"},{"id":"159982","messageId":"201101281335.41554.jnareb@gmail.com","threadId":"26328","inReplyTo":"7vvd1agoii.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] Fix wrong xhtml option to highlight","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2011-01-28T12:35:40Z","receivedAt":"2011-01-28T12:35:40Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"On Thu, 27 Jan 2011, Junio C Hamano wrote:\n> Drew Northup <drew.northup@maine.edu> writes:\n> \n>>>> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\n>>>> index 1025c2f..b662420 100755\n>>>> --- a/gitweb/gitweb.perl\n>>>> +++ b/gitweb/gitweb.perl\n>>>> @@ -3468,7 +3468,7 @@ sub run_highlighter {\n>>>>  \tclose $fd;\n>>>>  \topen $fd, quote_command(git_cmd(), \"cat-file\", \"blob\", $hash).\" | \".\n>>>>  \t          quote_command($highlight_bin).\n>>>> -\t          \" --xhtml --fragment --syntax $syntax |\"\n>>>> +\t          \" -xhtml --fragment --syntax $syntax |\"\n>>> \n>>> Curious.\n>>> \n>>> Does the command take double-dash for the fragment and syntax options but\n>>> a single dash for the xhtml option?  Really...\n>>> \n>>> A few top hits returned by Google for \"highlight manual page\" tells me\n>>> otherwise.\n>>\n>> Certainly appears to be the case that \"--xhtml\" is the option in Ubuntu\n>> 10.04.1 LTS. \n>>\n>> Jochen,\n>> Did you mean \"-X\" (which sets the same option)?\n> \n> The current proposal is to drop --xhtml and let highlight default to HTML.\n> \n> Honestly speaking, I don't like the approach very much; it would have been\n> much better if highlight had a single way that is supported throughout its\n> versions to specify the output format.  But it appears that there isn't,\n> and relying on and hoping for its default to stay HTML is the best we\n> could do, if we plan to support highlight 2.4.something or older.\n> \n> The copy of U10.04 I have has highlight 2.12, and according to its manual\n> pages, -X, --xhtml, and --out-format=xhtml mean the same thing.  HTML is\n> the default.\n> \n> The change-log at www.andre-simon.de indicates that --out-format has\n> become the preferred method and the short options like -X and -H are not\n> supported in recent versions (3.0 beta and newer).\n> \n> But as Jakub mentioned, 2.4.5 did not have --output-format; it was only in\n> 3.0 beta that -O was redefined to mean --output-format and in old versions\n> the short option meant something else.\n\nWell, we can always require highlight >= 2.12, or whatever version\nintroduced --out-format option.\n\n> \n> What a mess...\n> \n> The next time we introduce a new dependency, we really should try hard to\n> assess the stability and maturity of that dependency.  In hindsight, I\n> think \"highlight\" was probably a bit too premature to be depended upon.\n\nBy the way, the idea was to make it possible to configure other highlighter,\nbut I went with what I known to work, i.e. with Andre Simon's \"highlight\". \nI think it could be fairly easy to make it configurable via existing\n$highlight_bin and to be introduced @highlight_args gitweb configuration\nvariables.\n\nThere are three possible ways to do syntax highlighting in gitweb:\nfilter, Perl module, or via JavaScript.  An alternative to \"highlight\"\nas a filter could be GNU source-highlight... if not for the fact that\nit doesn't seem to support equivalent of \"highlight\" --fragment option,\ni.e. exclude prolog and <pre><tt> wrappers.\n\n-- \nJakub Narebski\nPoland\n"}]}