{"thread":{"id":"26339","subject":"[PATCH] Pass \"-O xhtml\" param to highlight instead of \"-xhtml\"","startedAt":"2011-01-26T17:11:19Z","lastAt":"2011-01-27T12:51:51Z","messageCount":5,"participants":["Adam Tkac","Jakub Narebski","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"159894","messageId":"20110126171118.GA867@traged.englab.brq.redhat.com","threadId":"26339","inReplyTo":null,"subject":"[PATCH] Pass \"-O xhtml\" param to highlight instead of \"-xhtml\"","fromName":"Adam Tkac","fromEmail":"atkac@redhat.com","sentAt":"2011-01-26T17:11:19Z","receivedAt":"2011-01-26T17:11:19Z","isPatch":true,"sender":{"key":"atkac@redhat.com","avatar":null},"body":"Hello,\n\nattached patch fixes the gitweb.perl script. Current highlight utility\ndoesn't recognize --xhtml parameter, it recognizes only \"-O xhtml\" parameter.\n\nReference: https://bugzilla.redhat.com/show_bug.cgi?id=672293\n\nRegards, Adam\n\n-- \nAdam Tkac, Red Hat, Inc.\n\n\n>From ec8043a730c165d8b438ccaba7c3cf5dc5fa65bc Mon Sep 17 00:00:00 2001\nFrom: Adam Tkac <atkac@redhat.com>\nDate: Wed, 26 Jan 2011 17:46:29 +0100\nSubject: [PATCH] Pass \"-O xhtml\" parameter instead of \"--xhtml\" to hightlight in gitweb.\n\nSigned-off-by: Jochen Schmitt <jochen@herr-schmitt.de>\nSigned-off-by: Adam Tkac <atkac@redhat.com>\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..88556f4 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          \" -O 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.5\n\n"},{"id":"159921","messageId":"m339ofbb9t.fsf@localhost.localdomain","threadId":"26339","inReplyTo":"20110126171118.GA867@traged.englab.brq.redhat.com","subject":"Re: [PATCH] Pass \"-O xhtml\" param to highlight instead of \"-xhtml\"","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2011-01-26T21:34:32Z","receivedAt":"2011-01-26T21:34:32Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Adam Tkac <atkac@redhat.com> writes:\n\n> Hello,\n> \n> attached patch fixes the gitweb.perl script.\n\nPlease don't send patches as attachements, but inline.\nSee Documentation/SubmittingPatches\n\n> Current highlight utility doesn't recognize \"--xhtml\" parameter, it\n> recognizes only \"-O xhtml\" parameter.\n> \n> Reference: https://bugzilla.redhat.com/show_bug.cgi?id=672293\n\nShouldn't the above be in commit message?\n\n> Subject: [PATCH] Pass \"-O xhtml\" parameter instead of \"--xhtml\" to hightlight in gitweb.\n\nWhy the mismatch between subject of email, and subject in attached\npatch?\n\n> Signed-off-by: Jochen Schmitt <jochen@herr-schmitt.de>\n> Signed-off-by: Adam Tkac <atkac@redhat.com>\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..88556f4 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          \" -O xhtml --fragment --syntax $syntax |\"\n>  \t\tor die_error(500, \"Couldn't open file or run syntax highlighter\");\n>  \treturn $fd;\n>  }\n\nIn highlight 2.4.5 '-O' means \"name of output directory\", i.e. --outdir.\nThere is no --out-format either.\n\nWTF this backward incompatibile change in highlight... the only\nsolution that would make it work both for old and for new versions is\nto rely on the fact that HTML is default output format, i.e.\n\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          \" --fragment --syntax $syntax |\"\n  \t\tor die_error(500, \"Couldn't open file or run syntax highlighter\");\n\n\n-- \nJakub Narebski\nPoland\nShadeHawk on #git\n"},{"id":"159924","messageId":"7vaainjq7f.fsf@alter.siamese.dyndns.org","threadId":"26339","inReplyTo":"m339ofbb9t.fsf@localhost.localdomain","subject":"Re: [PATCH] Pass \"-O xhtml\" param to highlight instead of \"-xhtml\"","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-01-26T21:43:48Z","receivedAt":"2011-01-26T21:43:48Z","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>> Current highlight utility doesn't recognize \"--xhtml\" parameter, it\n>> recognizes only \"-O xhtml\" parameter.\n>> \n>> Reference: https://bugzilla.redhat.com/show_bug.cgi?id=672293\n>\n> Shouldn't the above be in commit message?\n\nActually, I prefer not having that \"Reference\" in the commit message\nmyself, but I do want to have some relevant details\nmissing from the proposed commit message but is in\nthat ticket (especially the comment #5) in the commit message.\n\n> In highlight 2.4.5 '-O' means \"name of output directory\", i.e. --outdir.\n> There is no --out-format either.\n\nThanks for digging about 2.4.5; in that case, unlike the redhat ticket\nhinted, this change may not be backward compatible enough, as it seems\nthat the compatibility goes only back to 3.0.something.\n\n>\n> WTF this backward incompatibile change in highlight... the only\n> solution that would make it work both for old and for new versions is\n> to rely on the fact that HTML is default output format, i.e.\n>\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          \" --fragment --syntax $syntax |\"\n>   \t\tor die_error(500, \"Couldn't open file or run syntax highlighter\");\n\nAdam, Jochen?  How does the counterproposal look to you?\n\nWithout knowing much about highlight nor using gitweb in general myself,\nthe above looks a bit more reasonable fix to the issue, if the default\nformat has been and will stay to be HTML.\n"},{"id":"159945","messageId":"20110127120323.GA3416@traged.englab.brq.redhat.com","threadId":"26339","inReplyTo":"7vaainjq7f.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] Pass \"-O xhtml\" param to highlight instead of \"-xhtml\"","fromName":"Adam Tkac","fromEmail":"atkac@redhat.com","sentAt":"2011-01-27T12:03:23Z","receivedAt":"2011-01-27T12:03:23Z","isPatch":true,"sender":{"key":"atkac@redhat.com","avatar":null},"body":"On Wed, Jan 26, 2011 at 01:43:48PM -0800, Junio C Hamano wrote:\n> Jakub Narebski <jnareb@gmail.com> writes:\n> \n> >> Current highlight utility doesn't recognize \"--xhtml\" parameter, it\n> >> recognizes only \"-O xhtml\" parameter.\n> >> \n> >> Reference: https://bugzilla.redhat.com/show_bug.cgi?id=672293\n> >\n> > Shouldn't the above be in commit message?\n> \n> Actually, I prefer not having that \"Reference\" in the commit message\n> myself, but I do want to have some relevant details\n> missing from the proposed commit message but is in\n> that ticket (especially the comment #5) in the commit message.\n> \n> > In highlight 2.4.5 '-O' means \"name of output directory\", i.e. --outdir.\n> > There is no --out-format either.\n> \n> Thanks for digging about 2.4.5; in that case, unlike the redhat ticket\n> hinted, this change may not be backward compatible enough, as it seems\n> that the compatibility goes only back to 3.0.something.\n\nRight you are, I digged too shallowly, thanks for your inspection.\n\n> \n> >\n> > WTF this backward incompatibile change in highlight... the only\n> > solution that would make it work both for old and for new versions is\n> > to rely on the fact that HTML is default output format, i.e.\n> >\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          \" --fragment --syntax $syntax |\"\n> >   \t\tor die_error(500, \"Couldn't open file or run syntax highlighter\");\n> \n> Adam, Jochen?  How does the counterproposal look to you?\n> \n> Without knowing much about highlight nor using gitweb in general myself,\n> the above looks a bit more reasonable fix to the issue, if the default\n> format has been and will stay to be HTML.\n\nThe proposal looks like the best (and the only one) correct solution.\nI will send updated patch.\n\nRegards, Adam\n\n-- \nAdam Tkac, Red Hat, Inc.\n"},{"id":"159947","messageId":"20110127125151.GA19072@traged.englab.brq.redhat.com","threadId":"26339","inReplyTo":"20110127120323.GA3416@traged.englab.brq.redhat.com","subject":"[PATCH] Don't pass \"--xhtml\" to hightlight in gitweb.perl script.","fromName":"Adam Tkac","fromEmail":"atkac@redhat.com","sentAt":"2011-01-27T12:51:51Z","receivedAt":"2011-01-27T12:51:51Z","isPatch":true,"sender":{"key":"atkac@redhat.com","avatar":null},"body":"The \"--xhtml\" option is supported only in highlight < 3.0. There is no option\nto enforce (X)HTML output format compatible with both highlight < 3.0 and\nhighlight >= 3.0. However default output format is HTML so we don't need to\nexplicitly specify it.\n\nSigned-off-by: Adam Tkac <atkac@redhat.com>\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..0779f12 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          \" --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.5\n"}]}