From: Jakub Narebski <jnareb@gmail.com>
To: git@vger.kernel.org
Cc: Jakub Narebski <jnareb@gmail.com>
Subject: [PATCH] gitweb: gitweb_check_feature always return list
Date: Fri, 1 Sep 2006 21:31:08 +0200 [thread overview]
Message-ID: <11571390683018-git-send-email-jnareb@gmail.com> (raw)
In-Reply-To: <ed8a90$pfn$1@sea.gmane.org>
Modified feature_blame so it returns one-element list and not scalar,
thus making gitweb_check_feature always return list. Updated comment
to explain that part.
This is continuation of Aneesh Kumar work:
gitweb: Fix git_blame
"Converting the default values to array broke the git blame enable
disable support. Fix the same."
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
We could modify %feature hash so the 'default' value could be either
array reference or a scalar instead.
gitweb/gitweb.perl | 13 ++++++++-----
1 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 57ffa25..06bdb0e 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -74,9 +74,12 @@ our %feature = (
#
# if feature is overridable (it means that allow-override has true value,
# then feature-sub will be called with default options as parameters;
- # return value of feature-sub indicates if to enable specified feature
+ # return value of feature-sub indicates if to enable specified feature,
+ # and is taken to be current parameters of the feature
#
- # use gitweb_check_feature(<feature>) to check if <feature> is enabled
+ # use gitweb_check_feature(<feature>) to check if <feature> is enabled;
+ # to be more exact to get current parameters of <feature>;
+ # gitweb_check_feature(<feature>) returns array (list) of current options
'blame' => {
'sub' => \&feature_blame,
@@ -111,12 +114,12 @@ sub feature_blame {
my ($val) = git_get_project_config('blame', '--bool');
if ($val eq 'true') {
- return 1;
+ return (1);
} elsif ($val eq 'false') {
- return 0;
+ return (0);
}
- return $_[0];
+ return ($_[0]);
}
# To disable system wide have in $GITWEB_CONFIG
--
1.4.1.1
next prev parent reply other threads:[~2006-09-01 19:31 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-01 3:43 [PATCH] gitweb: Fix git_blame Aneesh Kumar K.V
2006-09-01 9:07 ` Jakub Narebski
2006-09-01 19:31 ` Jakub Narebski [this message]
2006-09-01 19:37 ` [PATCH] gitweb: gitweb_check_feature always return list Junio C Hamano
2006-09-01 19:48 ` Jakub Narebski
2006-09-01 20:12 ` Jakub Narebski
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=11571390683018-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).