{"thread":{"id":"26157","subject":"[PATCH 0/3 v3] minor gitweb modifications","startedAt":"2010-12-29T19:33:32Z","lastAt":"2010-12-29T22:44:37Z","messageCount":6,"participants":["Sylvain Rabot","Jakub Narebski"],"isPatch":true,"patchVersion":3,"patchTotal":3},"messages":[{"id":"158723","messageId":"1293651215-4924-1-git-send-email-sylvain@abstraction.fr","threadId":"26157","inReplyTo":null,"subject":"[PATCH 0/3 v3] minor gitweb modifications","fromName":"Sylvain Rabot","fromEmail":"sylvain@abstraction.fr","sentAt":"2010-12-29T19:33:32Z","receivedAt":"2010-12-29T19:33:32Z","isPatch":true,"sender":{"key":"sylvain@abstraction.fr","avatar":"https://avatars.githubusercontent.com/u/153052?v=4"},"body":"here a three patch serie with minor updates for gitweb based on master.\n\nThis serie has been improved regarding the comments of :\n\n - Jakub Narebski <jnareb@gmail.com>\n - Jonathan Nieder <jrnieder@gmail.com>\n\nRegards.\n\nSylvain Rabot (3):\n  gitweb: add extensions to highlight feature\n  gitweb: remove test when closing file descriptor\n  gitweb: add css class to remote url titles\n\n gitweb/gitweb.perl       |   18 +++++++++---------\n gitweb/static/gitweb.css |    5 +++++\n 2 files changed, 14 insertions(+), 9 deletions(-)\n\n-- \n1.7.3.4.523.g72f0d.dirty\n"},{"id":"158724","messageId":"1293651215-4924-2-git-send-email-sylvain@abstraction.fr","threadId":"26157","inReplyTo":"1293651215-4924-1-git-send-email-sylvain@abstraction.fr","subject":"[PATCH 1/3] gitweb: add extensions to highlight feature","fromName":"Sylvain Rabot","fromEmail":"sylvain@abstraction.fr","sentAt":"2010-12-29T19:33:33Z","receivedAt":"2010-12-29T19:33:33Z","isPatch":true,"sender":{"key":"sylvain@abstraction.fr","avatar":"https://avatars.githubusercontent.com/u/153052?v=4"},"body":"added: sql, php5, phps, bash, zsh, ksh, mk, make\n\nSigned-off-by: Sylvain Rabot <sylvain@abstraction.fr>\n---\n gitweb/gitweb.perl |    7 ++++---\n 1 files changed, 4 insertions(+), 3 deletions(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex 4779618..ea984b9 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -250,13 +250,14 @@ our %highlight_ext = (\n \t# main extensions, defining name of syntax;\n \t# see files in /usr/share/highlight/langDefs/ directory\n \tmap { $_ => $_ }\n-\t\tqw(py c cpp rb java css php sh pl js tex bib xml awk bat ini spec tcl),\n+\t\tqw(py c cpp rb java css php sh pl js tex bib xml awk bat ini spec tcl sql make),\n \t# alternate extensions, see /etc/highlight/filetypes.conf\n \t'h' => 'c',\n+\tmap { $_ => 'sh'  } qw(bash zsh ksh),\n \tmap { $_ => 'cpp' } qw(cxx c++ cc),\n-\tmap { $_ => 'php' } qw(php3 php4),\n+\tmap { $_ => 'php' } qw(php3 php4 php5 phps),\n \tmap { $_ => 'pl'  } qw(perl pm), # perhaps also 'cgi'\n-\t'mak' => 'make',\n+\tmap { $_ => 'make'} qw(mak mk),\n \tmap { $_ => 'xml' } qw(xhtml html htm),\n );\n \n-- \n1.7.3.4.523.g72f0d.dirty\n"},{"id":"158725","messageId":"1293651215-4924-3-git-send-email-sylvain@abstraction.fr","threadId":"26157","inReplyTo":"1293651215-4924-1-git-send-email-sylvain@abstraction.fr","subject":"[PATCH 2/3] gitweb: remove test when closing file descriptor","fromName":"Sylvain Rabot","fromEmail":"sylvain@abstraction.fr","sentAt":"2010-12-29T19:33:34Z","receivedAt":"2010-12-29T19:33:34Z","isPatch":true,"sender":{"key":"sylvain@abstraction.fr","avatar":"https://avatars.githubusercontent.com/u/153052?v=4"},"body":"it happens that closing file descriptor fails whereas\nthe blob is perfectly readable. According to perlman\nthe reasons could be:\n\n   If the file handle came from a piped open, \"close\" will additionally\n   return false if one of the other system calls involved fails, or if the\n   program exits with non-zero status.  (If the only problem was that the\n   program exited non-zero, $! will be set to 0.)  Closing a pipe also waits\n   for the process executing on the pipe to complete, in case you want to\n   look at the output of the pipe afterwards, and implicitly puts the exit\n   status value of that command into $?.\n\n   Prematurely closing the read end of a pipe (i.e. before the process writ-\n   ing to it at the other end has closed it) will result in a SIGPIPE being\n   delivered to the writer.  If the other end can't handle that, be sure to\n   read all the data before closing the pipe.\n\nIn this case we don't mind that close fails.\n\nSigned-off-by: Sylvain Rabot <sylvain@abstraction.fr>\n---\n gitweb/gitweb.perl |    3 +--\n 1 files changed, 1 insertions(+), 2 deletions(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex ea984b9..eae75ac 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -3465,8 +3465,7 @@ sub run_highlighter {\n \tmy ($fd, $highlight, $syntax) = @_;\n \treturn $fd unless ($highlight && defined $syntax);\n \n-\tclose $fd\n-\t\tor die_error(404, \"Reading blob failed\");\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-- \n1.7.3.4.523.g72f0d.dirty\n"},{"id":"158726","messageId":"1293651215-4924-4-git-send-email-sylvain@abstraction.fr","threadId":"26157","inReplyTo":"1293651215-4924-1-git-send-email-sylvain@abstraction.fr","subject":"[PATCH 3/3] gitweb: add css class to remote url titles","fromName":"Sylvain Rabot","fromEmail":"sylvain@abstraction.fr","sentAt":"2010-12-29T19:33:35Z","receivedAt":"2010-12-29T19:33:35Z","isPatch":true,"sender":{"key":"sylvain@abstraction.fr","avatar":"https://avatars.githubusercontent.com/u/153052?v=4"},"body":"Signed-off-by: Sylvain Rabot <sylvain@abstraction.fr>\n---\n gitweb/gitweb.perl       |    8 ++++----\n gitweb/static/gitweb.css |    5 +++++\n 2 files changed, 9 insertions(+), 4 deletions(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex eae75ac..cb169c7 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -5146,13 +5146,13 @@ sub git_remote_block {\n \n \tif (defined $fetch) {\n \t\tif ($fetch eq $push) {\n-\t\t\t$urls_table .= format_repo_url(\"URL\", $fetch);\n+\t\t\t$urls_table .= format_repo_url(\"<span class=\\\"metadata_remote_fetch_url\\\">URL</span>\", $fetch);\n \t\t} else {\n-\t\t\t$urls_table .= format_repo_url(\"Fetch URL\", $fetch);\n-\t\t\t$urls_table .= format_repo_url(\"Push URL\", $push) if defined $push;\n+\t\t\t$urls_table .= format_repo_url(\"<span class=\\\"metadata_remote_fetch_url\\\">Fetch URL</span>\", $fetch);\n+\t\t\t$urls_table .= format_repo_url(\"<span class=\\\"metadata_remote_push_url\\\">Push URL</span>\", $push) if defined $push;\n \t\t}\n \t} elsif (defined $push) {\n-\t\t$urls_table .= format_repo_url(\"Push URL\", $push);\n+\t\t$urls_table .= format_repo_url(\"<span class=\\\"metadata_remote_push_url\\\">Push URL</span>\", $push);\n \t} else {\n \t\t$urls_table .= format_repo_url(\"\", \"No remote URL\");\n \t}\ndiff --git a/gitweb/static/gitweb.css b/gitweb/static/gitweb.css\nindex 79d7eeb..631b20d 100644\n--- a/gitweb/static/gitweb.css\n+++ b/gitweb/static/gitweb.css\n@@ -579,6 +579,11 @@ div.remote {\n \tdisplay: inline-block;\n }\n \n+.metadata_remote_fetch_url,\n+.metadata_remote_push_url {\n+\tfont-weight: bold;\n+}\n+\n /* Style definition generated by highlight 2.4.5, http://www.andre-simon.de/ */\n \n /* Highlighting theme definition: */\n-- \n1.7.3.4.523.g72f0d.dirty\n"},{"id":"158735","messageId":"m3fwtgcido.fsf@localhost.localdomain","threadId":"26157","inReplyTo":"1293651215-4924-1-git-send-email-sylvain@abstraction.fr","subject":"Re: [PATCH 0/3 v3] minor gitweb modifications","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2010-12-29T22:41:40Z","receivedAt":"2010-12-29T22:41:40Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Sylvain Rabot <sylvain@abstraction.fr> writes:\n\n> here a three patch serie with minor updates for gitweb based on master.\n> \n> This serie has been improved regarding the comments of :\n> \n>  - Jakub Narebski <jnareb@gmail.com>\n>  - Jonathan Nieder <jrnieder@gmail.com>\n> \n> Regards.\n\nA few comments, in this version about commit messages, not the code:\n \n> Sylvain Rabot (3):\n>   gitweb: add extensions to highlight feature\n\nIt is about adding support for supporting additional file extensions\nfor syntax highlighting, not about extending the highlight feature or\nadding some plugin thingy to it, as one can think on first read.\n\n>   gitweb: remove test when closing file descriptor\n\nIt is about closing open pipe (file descriptor) without checking for\nerror in the case where we don't care about errors in the caller; in\nshort about not testing status of closing filehandle in git_highlight\n\n>   gitweb: add css class to remote url titles\n\nIt is about distinguishing visually type of link using styles; adding\nCSS class is just a way to do it.\n\nThis actually has few comments about code.\n\n> \n>  gitweb/gitweb.perl       |   18 +++++++++---------\n>  gitweb/static/gitweb.css |    5 +++++\n>  2 files changed, 14 insertions(+), 9 deletions(-)\n> \n> -- \n> 1.7.3.4.523.g72f0d.dirty\n> \n\n-- \nJakub Narebski\nPoland\nShadeHawk on #git\n"},{"id":"158736","messageId":"m3bp44ci8p.fsf@localhost.localdomain","threadId":"26157","inReplyTo":"1293651215-4924-4-git-send-email-sylvain@abstraction.fr","subject":"Re: [PATCH 3/3] gitweb: add css class to remote url titles","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2010-12-29T22:44:37Z","receivedAt":"2010-12-29T22:44:37Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Sylvain Rabot <sylvain@abstraction.fr> writes:\n\n> Signed-off-by: Sylvain Rabot <sylvain@abstraction.fr>\n> ---\n>  gitweb/gitweb.perl       |    8 ++++----\n>  gitweb/static/gitweb.css |    5 +++++\n>  2 files changed, 9 insertions(+), 4 deletions(-)\n> \n> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\n> index eae75ac..cb169c7 100755\n> --- a/gitweb/gitweb.perl\n> +++ b/gitweb/gitweb.perl\n> @@ -5146,13 +5146,13 @@ sub git_remote_block {\n>  \n>  \tif (defined $fetch) {\n>  \t\tif ($fetch eq $push) {\n> -\t\t\t$urls_table .= format_repo_url(\"URL\", $fetch);\n> +\t\t\t$urls_table .= format_repo_url(\"<span class=\\\"metadata_remote_fetch_url\\\">URL</span>\", $fetch);\n>  \t\t} else {\n> -\t\t\t$urls_table .= format_repo_url(\"Fetch URL\", $fetch);\n> -\t\t\t$urls_table .= format_repo_url(\"Push URL\", $push) if defined $push;\n> +\t\t\t$urls_table .= format_repo_url(\"<span class=\\\"metadata_remote_fetch_url\\\">Fetch URL</span>\", $fetch);\n> +\t\t\t$urls_table .= format_repo_url(\"<span class=\\\"metadata_remote_push_url\\\">Push URL</span>\", $push) if defined $push;\n>  \t\t}\n>  \t} elsif (defined $push) {\n> -\t\t$urls_table .= format_repo_url(\"Push URL\", $push);\n> +\t\t$urls_table .= format_repo_url(\"<span class=\\\"metadata_remote_push_url\\\">Push URL</span>\", $push);\n>  \t} else {\n>  \t\t$urls_table .= format_repo_url(\"\", \"No remote URL\");\n>  \t}\n\nI'm not sure if in this situation if it would not be better to extend\nformat_repo_url subroutine to take additional parameter describing\n_type_ of repo URL; it then would do styling internally.  Which means\nmoving wrapping 'URL', 'Fetch URL' etc. in span element to\nformat_repo_url from the caller.\n\n> diff --git a/gitweb/static/gitweb.css b/gitweb/static/gitweb.css\n> index 79d7eeb..631b20d 100644\n> --- a/gitweb/static/gitweb.css\n> +++ b/gitweb/static/gitweb.css\n> @@ -579,6 +579,11 @@ div.remote {\n>  \tdisplay: inline-block;\n>  }\n>  \n> +.metadata_remote_fetch_url,\n> +.metadata_remote_push_url {\n> +\tfont-weight: bold;\n> +}\n> +\n\nGood!\n\n-- \nJakub Narebski\nPoland\nShadeHawk on #git\n"}]}