From: Jakub Narebski <jnareb@gmail.com>
To: git@vger.kernel.org
Cc: Jakub Narebski <jnareb@gmail.com>
Subject: [PATCH] gitweb: Uniquify usage of subroutine prototypes
Date: Tue, 25 Mar 2008 13:11:54 +0100 [thread overview]
Message-ID: <1206447114-29349-1-git-send-email-jnareb@gmail.com> (raw)
The idea is NOT to use subroutine prototypes to create new syntax;
prototypes are to be purely informational and optional. Subroutine
prototypes are meant in gitweb to mark untypical parameters, like
having hash as an argument, or using hash for last parameter to pass
extra options to subroutine.
(Truth to be told this change was caused by the fact that CPerl mode,
Perl mode for GNU Emacs, got confused in presence of "sub name($) {"
prototype...)
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
gitweb/gitweb.perl | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index ec73cb1..ee5cbd6 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -587,7 +587,7 @@ exit;
## ======================================================================
## action links
-sub href(%) {
+sub href (%) {
my %params = @_;
# default is to use -absolute url() i.e. $my_uri
my $href = $params{-full} ? $my_url : $my_uri;
@@ -740,7 +740,7 @@ sub esc_html ($;%) {
}
# quote control characters and escape filename to HTML
-sub esc_path {
+sub esc_path ($;%) {
my $str = shift;
my %opts = @_;
@@ -754,7 +754,7 @@ sub esc_path {
}
# Make control characters "printable", using character escape codes (CEC)
-sub quot_cec {
+sub quot_cec ($;%) {
my $cntrl = shift;
my %opts = @_;
my %es = ( # character escape codes, aka escape sequences
@@ -780,7 +780,7 @@ sub quot_cec {
# Alternatively use unicode control pictures codepoints,
# Unicode "printable representation" (PR)
-sub quot_upr {
+sub quot_upr ($;%) {
my $cntrl = shift;
my %opts = @_;
@@ -982,7 +982,7 @@ use constant {
};
# submodule/subproject, a commit object reference
-sub S_ISGITLINK($) {
+sub S_ISGITLINK {
my $mode = shift;
return (($mode & S_IFMT) == S_IFGITLINK)
--
1.5.4.4
next reply other threads:[~2008-03-25 12:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-25 12:11 Jakub Narebski [this message]
2008-03-25 19:47 ` [PATCH] gitweb: Uniquify usage of subroutine prototypes Junio C Hamano
2008-03-25 22:06 ` Rafael Garcia-Suarez
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1206447114-29349-1-git-send-email-jnareb@gmail.com \
--to=jnareb@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).