{"thread":{"id":"19235","subject":"[PATCH] gitweb: Remove function prototypes (cleanup)","startedAt":"2009-05-07T17:11:29Z","lastAt":"2009-05-07T17:11:29Z","messageCount":1,"participants":["Jakub Narebski"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"113234","messageId":"20090507171023.6496.96049.stgit@localhost.localdomain","threadId":"19235","inReplyTo":null,"subject":"[PATCH] gitweb: Remove function prototypes (cleanup)","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2009-05-07T17:11:29Z","receivedAt":"2009-05-07T17:11:29Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Use of function prototypes is considered bad practice in Perl.  The\nones used here didn't accomplish anything anyhow, so they've been\nremoved.\n\n>From perlsub(1):\n\n  [...] the intent of this feature [prototypes] is primarily to let\n  you define subroutines that work like built-in functions [...]\n  you can generate new syntax with it [...]\n\nWe don't want to have subroutines behaving exactly like built-in\nfunctions, we don't want to define new syntax / syntactic sugar, so\nprototypes in gitweb are not needed... and they can have unintended\nconsequences.\n\nSigned-off-by: Jakub Narebski <jnareb@gmail.com>\n---\nThis follows similar patch for git-send-email.perl by Bill Pemberton.\n\nAlso \"sub S_ISGITLINK($) {\" line caused `imenu` in my old cperl-mode\n(4.23) in GNU Emacs 21.4.1 to fail, sometimes.\n\n gitweb/gitweb.perl |   12 +++++-------\n 1 files changed, 5 insertions(+), 7 deletions(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex 3f99361..06e9160 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -838,7 +838,7 @@ exit;\n ## ======================================================================\n ## action links\n \n-sub href (%) {\n+sub href {\n \tmy %params = @_;\n \t# default is to use -absolute url() i.e. $my_uri\n \tmy $href = $params{-full} ? $my_url : $my_uri;\n@@ -1036,7 +1036,7 @@ sub esc_url {\n }\n \n # replace invalid utf8 character with SUBSTITUTION sequence\n-sub esc_html ($;%) {\n+sub esc_html {\n \tmy $str = shift;\n \tmy %opts = @_;\n \n@@ -1296,7 +1296,7 @@ use constant {\n };\n \n # submodule/subproject, a commit object reference\n-sub S_ISGITLINK($) {\n+sub S_ISGITLINK {\n \tmy $mode = shift;\n \n \treturn (($mode & S_IFMT) == S_IFGITLINK)\n@@ -2615,7 +2615,7 @@ sub parsed_difftree_line {\n }\n \n # parse line of git-ls-tree output\n-sub parse_ls_tree_line ($;%) {\n+sub parse_ls_tree_line {\n \tmy $line = shift;\n \tmy %opts = @_;\n \tmy %res;\n@@ -3213,7 +3213,6 @@ sub git_print_header_div {\n \t      \"\\n</div>\\n\";\n }\n \n-#sub git_print_authorship (\\%) {\n sub git_print_authorship {\n \tmy $co = shift;\n \n@@ -3269,8 +3268,7 @@ sub git_print_page_path {\n \tprint \"<br/></div>\\n\";\n }\n \n-# sub git_print_log (\\@;%) {\n-sub git_print_log ($;%) {\n+sub git_print_log {\n \tmy $log = shift;\n \tmy %opts = @_;\n \n"}]}