{"thread":{"id":"25079","subject":"[PATCH 0/3] t/gitweb-lib.sh improvements","startedAt":"2010-09-12T09:41:03Z","lastAt":"2010-09-16T19:58:17Z","messageCount":8,"participants":["Jakub Narebski","Ævar Arnfjörð Bjarmason","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"150525","messageId":"1284284466-14506-1-git-send-email-jnareb@gmail.com","threadId":"25079","inReplyTo":null,"subject":"[PATCH 0/3] t/gitweb-lib.sh improvements","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2010-09-12T09:41:03Z","receivedAt":"2010-09-12T09:41:03Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"This series of patches is meant as preparation for splitting gitweb;\nthe most important (but only RFC) is the last patch adding support for\nGITWEB_TEST_INSTALLED, similar to GIT_TEST_INSTALLED from\nt/test-lib.sh\n\nComments appreciated.\n\nJakub Narebski (3):\n  t/gitweb-lib.sh: Use GIT_BUILD_DIR\n  t/gitweb-lib.sh: Use tabs for indent consistently\n  t/gitweb-lib.sh: Add support for GITWEB_TEST_INSTALLED\n\n t/gitweb-lib.sh |   25 ++++++++++++++++++-------\n 1 files changed, 18 insertions(+), 7 deletions(-)\n mode change 100644 => 100755 t/gitweb-lib.sh\n\n-- \n1.7.2.1\n"},{"id":"150526","messageId":"1284284466-14506-2-git-send-email-jnareb@gmail.com","threadId":"25079","inReplyTo":"1284284466-14506-1-git-send-email-jnareb@gmail.com","subject":"[PATCH 1/3] t/gitweb-lib.sh: Use GIT_BUILD_DIR","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2010-09-12T09:41:04Z","receivedAt":"2010-09-12T09:41:04Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Use \"$GIT_BUILD_DIR\" instead of \"$TEST_DIRECTORY/..\" (both defined in\nt/test-lib.sh) in t/gitweb-lib.sh.  It better describes the intent.\n\nSigned-off-by: Jakub Narebski <jnareb@gmail.com>\n---\nI think it makes gitweb_init() and gitweb_install() more clear.\n\n t/gitweb-lib.sh |    8 ++++----\n 1 files changed, 4 insertions(+), 4 deletions(-)\n mode change 100644 => 100755 t/gitweb-lib.sh\n\ndiff --git a/t/gitweb-lib.sh b/t/gitweb-lib.sh\nold mode 100644\nnew mode 100755\nindex 81ef2a0..8fad236\n--- a/t/gitweb-lib.sh\n+++ b/t/gitweb-lib.sh\n@@ -19,9 +19,9 @@ our \\$site_name = '[localhost]';\n our \\$site_header = '';\n our \\$site_footer = '';\n our \\$home_text = 'indextext.html';\n-our @stylesheets = ('file:///$TEST_DIRECTORY/../gitweb/static/gitweb.css');\n-our \\$logo = 'file:///$TEST_DIRECTORY/../gitweb/static/git-logo.png';\n-our \\$favicon = 'file:///$TEST_DIRECTORY/../gitweb/static/git-favicon.png';\n+our @stylesheets = ('file:///$GIT_BUILD_DIR/gitweb/static/gitweb.css');\n+our \\$logo = 'file:///$GIT_BUILD_DIR/gitweb/static/git-logo.png';\n+our \\$favicon = 'file:///$GIT_BUILD_DIR/gitweb/static/git-favicon.png';\n our \\$projects_list = '';\n our \\$export_ok = '';\n our \\$strict_export = '';\n@@ -38,7 +38,7 @@ gitweb_run () {\n \tGATEWAY_INTERFACE='CGI/1.1'\n \tHTTP_ACCEPT='*/*'\n \tREQUEST_METHOD='GET'\n-\tSCRIPT_NAME=\"$TEST_DIRECTORY/../gitweb/gitweb.perl\"\n+\tSCRIPT_NAME=\"$GIT_BUILD_DIR/gitweb/gitweb.perl\"\n \tQUERY_STRING=\"\"$1\"\"\n \tPATH_INFO=\"\"$2\"\"\n \texport GATEWAY_INTERFACE HTTP_ACCEPT REQUEST_METHOD \\\n-- \n1.7.2.1\n"},{"id":"150528","messageId":"1284284466-14506-3-git-send-email-jnareb@gmail.com","threadId":"25079","inReplyTo":"1284284466-14506-1-git-send-email-jnareb@gmail.com","subject":"[PATCH 2/3] t/gitweb-lib.sh: Use tabs for indent consistently","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2010-09-12T09:41:05Z","receivedAt":"2010-09-12T09:41:05Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Signed-off-by: Jakub Narebski <jnareb@gmail.com>\n---\nWhitespace cleanup\n\n t/gitweb-lib.sh |    4 ++--\n 1 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/t/gitweb-lib.sh b/t/gitweb-lib.sh\nindex 8fad236..8c490c8 100755\n--- a/t/gitweb-lib.sh\n+++ b/t/gitweb-lib.sh\n@@ -81,8 +81,8 @@ if ! test_have_prereq PERL; then\n fi\n \n perl -MEncode -e 'decode_utf8(\"\", Encode::FB_CROAK)' >/dev/null 2>&1 || {\n-    skip_all='skipping gitweb tests, perl version is too old'\n-    test_done\n+\tskip_all='skipping gitweb tests, perl version is too old'\n+\ttest_done\n }\n \n gitweb_init\n-- \n1.7.2.1\n"},{"id":"150527","messageId":"1284284466-14506-4-git-send-email-jnareb@gmail.com","threadId":"25079","inReplyTo":"1284284466-14506-1-git-send-email-jnareb@gmail.com","subject":"[PATCH/RFC 3/3] t/gitweb-lib.sh: Add support for GITWEB_TEST_INSTALLED","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2010-09-12T09:41:06Z","receivedAt":"2010-09-12T09:41:06Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"You can set the GITWEB_TEST_INSTALLED environment variable to the\ngitwebdir (the directory where gitweb is installed / deployed to) of\nan existing gitweb instalation to test that installation.\n\nThis change is intended to make it possible to test that process of\ninstalling gitweb (and the modules it depends on) works correctly\nafter splitting gitweb.\n\nSigned-off-by: Jakub Narebski <jnareb@gmail.com>\n---\n\nIt is an RFC because I am not sure where to put documentation,\ni.e. description of GITWEB_TEST_INSTALLED.  Should it be put in\nt/README, in gitweb/README, or in gitweb/INSTALL, or in\nt/gitweb-lib.sh header?\n\n t/gitweb-lib.sh |   15 +++++++++++++--\n 1 files changed, 13 insertions(+), 2 deletions(-)\n\ndiff --git a/t/gitweb-lib.sh b/t/gitweb-lib.sh\nindex 8c490c8..b17459c 100755\n--- a/t/gitweb-lib.sh\n+++ b/t/gitweb-lib.sh\n@@ -32,17 +32,28 @@ EOF\n \tcat >.git/description <<EOF\n $0 test repository\n EOF\n+\n+\t# You can set the GITWEB_TEST_INSTALLED environment variable to\n+\t# the gitwebdir (the directory where gitweb is installed / deployed to)\n+\t# of an existing gitweb instalation to test that installation.\n+\tif test -n \"$GITWEB_TEST_INSTALLED\" ; then\n+\t\tSCRIPT_NAME=\"$GITWEB_TEST_INSTALLED/gitweb.cgi\"\n+\t\ttest -f \"$SCRIPT_NAME\" ||\n+\t\terror \"Cannot find gitweb.cgi at $GITWEB_TEST_INSTALLED.\"\n+\telse # normal case, use source version of gitweb\n+\t\tSCRIPT_NAME=\"$GIT_BUILD_DIR/gitweb/gitweb.perl\"\n+\tfi\n+\texport SCRIPT_NAME\n }\n \n gitweb_run () {\n \tGATEWAY_INTERFACE='CGI/1.1'\n \tHTTP_ACCEPT='*/*'\n \tREQUEST_METHOD='GET'\n-\tSCRIPT_NAME=\"$GIT_BUILD_DIR/gitweb/gitweb.perl\"\n \tQUERY_STRING=\"\"$1\"\"\n \tPATH_INFO=\"\"$2\"\"\n \texport GATEWAY_INTERFACE HTTP_ACCEPT REQUEST_METHOD \\\n-\t\tSCRIPT_NAME QUERY_STRING PATH_INFO\n+\t\tQUERY_STRING PATH_INFO\n \n \tGITWEB_CONFIG=$(pwd)/gitweb_config.perl\n \texport GITWEB_CONFIG\n-- \n1.7.2.1\n"},{"id":"150529","messageId":"AANLkTikbOdCCgHZ8VNjN=1Gdi5SzeFDgMMyjU=ab+2kz@mail.gmail.com","threadId":"25079","inReplyTo":"1284284466-14506-4-git-send-email-jnareb@gmail.com","subject":"Re: [PATCH/RFC 3/3] t/gitweb-lib.sh: Add support for GITWEB_TEST_INSTALLED","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-12T09:46:14Z","receivedAt":"2010-09-12T09:46:14Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Sun, Sep 12, 2010 at 09:41, Jakub Narebski <jnareb@gmail.com> wrote:\n> It is an RFC because I am not sure where to put documentation,\n> i.e. description of GITWEB_TEST_INSTALLED.  Should it be put in\n> t/README, in gitweb/README, or in gitweb/INSTALL, or in\n> t/gitweb-lib.sh header?\n\nThat looks like enough documentation as-is, we don't need to document\nevery test variable like that.\n"},{"id":"150541","messageId":"7vtylueuc4.fsf@alter.siamese.dyndns.org","threadId":"25079","inReplyTo":"1284284466-14506-4-git-send-email-jnareb@gmail.com","subject":"Re: [PATCH/RFC 3/3] t/gitweb-lib.sh: Add support for GITWEB_TEST_INSTALLED","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-09-12T17:37:47Z","receivedAt":"2010-09-12T17:37:47Z","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> It is an RFC because I am not sure where to put documentation,\n> i.e. description of GITWEB_TEST_INSTALLED.  Should it be put in\n> t/README, in gitweb/README, or in gitweb/INSTALL, or in\n> t/gitweb-lib.sh header?\n\nI think the comment in this file is fine.\n\n> +\t# You can set the GITWEB_TEST_INSTALLED environment variable to\n> +\t# the gitwebdir (the directory where gitweb is installed / deployed to)\n> +\t# of an existing gitweb instalation to test that installation.\n> +\tif test -n \"$GITWEB_TEST_INSTALLED\" ; then\n> +\t\tSCRIPT_NAME=\"$GITWEB_TEST_INSTALLED/gitweb.cgi\"\n> +\t\ttest -f \"$SCRIPT_NAME\" ||\n> +\t\terror \"Cannot find gitweb.cgi at $GITWEB_TEST_INSTALLED.\"\n\nI don't know if GIT_WEB_TEST_INSTALLED=/path/to/some/directory (naming the\ndirectory that houses the script which must be named gitweb.cgi) is easier\nto use than GIT_WEB_TEST_INSTALLED=/path/to/some/gitweb.perl (naming the\nscript that is allowed to be renamed).\n"},{"id":"150546","messageId":"201009122133.26427.jnareb@gmail.com","threadId":"25079","inReplyTo":"7vtylueuc4.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH/RFC 3/3] t/gitweb-lib.sh: Add support for GITWEB_TEST_INSTALLED","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2010-09-12T19:33:26Z","receivedAt":"2010-09-12T19:33:26Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"On Sun, 12 Sep 2010, Junio C Hamano wrote:\n> Jakub Narebski <jnareb@gmail.com> writes:\n> \n> > It is an RFC because I am not sure where to put documentation,\n> > i.e. description of GITWEB_TEST_INSTALLED.  Should it be put in\n> > t/README, in gitweb/README, or in gitweb/INSTALL, or in\n> > t/gitweb-lib.sh header?\n> \n> I think the comment in this file is fine.\n\nO.K.\n\n> > +\t# You can set the GITWEB_TEST_INSTALLED environment variable to\n> > +\t# the gitwebdir (the directory where gitweb is installed / deployed to)\n> > +\t# of an existing gitweb instalation to test that installation.\n> > +\tif test -n \"$GITWEB_TEST_INSTALLED\" ; then\n> > +\t\tSCRIPT_NAME=\"$GITWEB_TEST_INSTALLED/gitweb.cgi\"\n> > +\t\ttest -f \"$SCRIPT_NAME\" ||\n> > +\t\terror \"Cannot find gitweb.cgi at $GITWEB_TEST_INSTALLED.\"\n> \n> I don't know if GIT_WEB_TEST_INSTALLED=/path/to/some/directory (naming the\n> directory that houses the script which must be named gitweb.cgi) is easier\n> to use than GIT_WEB_TEST_INSTALLED=/path/to/some/gitweb.perl (naming the\n> script that is allowed to be renamed).\n\nFirst, I was following what GIT_TEST_INSTALLED does (it points to bindir,\nnot to git binary).  Second, I had half of idea to also change paths to\nstatic files... but they are not used anyway, at least not currently\n(no check for links).\n\nAnyway we can support both situations, slightly similarly to how\nGIT_TRACE can have different kinds of values.\n-- \nJakub Narebski\nPoland\n"},{"id":"150844","messageId":"201009162158.20730.jnareb@gmail.com","threadId":"25079","inReplyTo":"201009122133.26427.jnareb@gmail.com","subject":"[RFC/PATCHv2 3/3] t/gitweb-lib.sh: Add support for GITWEB_TEST_INSTALLED","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2010-09-16T19:58:17Z","receivedAt":"2010-09-16T19:58:17Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"You can set the GITWEB_TEST_INSTALLED environment variable to the\ngitwebdir (the directory where gitweb is installed / deployed to) of\nan existing gitweb instalation to test that installation.\n\nThis change is intended to make it possible to test that process of\ninstalling gitweb and the modules it depends on works correctly (after\nsplitting gitweb).\n\nSigned-off-by: Jakub Narebski <jnareb@gmail.com>\n---\nJakub Narebski wrote:\n> On Sun, 12 Sep 2010, Junio C Hamano wrote:\n> > Jakub Narebski <jnareb@gmail.com> writes:\n\n> > > +\t# You can set the GITWEB_TEST_INSTALLED environment variable to\n> > > +\t# the gitwebdir (the directory where gitweb is installed / deployed to)\n> > > +\t# of an existing gitweb instalation to test that installation.\n> > > +\tif test -n \"$GITWEB_TEST_INSTALLED\" ; then\n> > > +\t\tSCRIPT_NAME=\"$GITWEB_TEST_INSTALLED/gitweb.cgi\"\n> > > +\t\ttest -f \"$SCRIPT_NAME\" ||\n> > > +\t\terror \"Cannot find gitweb.cgi at $GITWEB_TEST_INSTALLED.\"\n> > \n> > I don't know if GIT_WEB_TEST_INSTALLED=/path/to/some/directory (naming the\n> > directory that houses the script which must be named gitweb.cgi) is easier\n> > to use than GIT_WEB_TEST_INSTALLED=/path/to/some/gitweb.perl (naming the\n> > script that is allowed to be renamed).\n> \n> First, I was following what GIT_TEST_INSTALLED does (it points to bindir,\n> not to git binary).  Second, I had half of idea to also change paths to\n> static files... but they are not used anyway, at least not currently\n> (no check for links).\n> \n> Anyway we can support both situations, slightly similarly to how\n> GIT_TRACE can have different kinds of values.\n\nAnd this implements it.\n\nIt is an RFC because it is not well tested... and I have forgot\nto update comment about GITWEB_TEST_INSTALLED and the commit message.\n\n t/gitweb-lib.sh |   19 +++++++++++++++++--\n 1 files changed, 17 insertions(+), 2 deletions(-)\n\ndiff --git a/t/gitweb-lib.sh b/t/gitweb-lib.sh\nindex 8c490c8..b76ec4d 100755\n--- a/t/gitweb-lib.sh\n+++ b/t/gitweb-lib.sh\n@@ -32,17 +32,32 @@ EOF\n \tcat >.git/description <<EOF\n $0 test repository\n EOF\n+\n+\t# You can set the GITWEB_TEST_INSTALLED environment variable to\n+\t# the gitwebdir (the directory where gitweb is installed / deployed to)\n+\t# of an existing gitweb instalation to test that installation.\n+\tif test -n \"$GITWEB_TEST_INSTALLED\" ; then\n+\t\tif test -d $GITWEB_TEST_INSTALLED; then\n+\t\t\tSCRIPT_NAME=\"$GITWEB_TEST_INSTALLED/gitweb.cgi\"\n+\t\telse\n+\t\t\tSCRIPT_NAME=\"$GITWEB_TEST_INSTALLED\"\n+\t\tfi\n+\t\ttest -f \"$SCRIPT_NAME\" ||\n+\t\terror \"Cannot find gitweb at $GITWEB_TEST_INSTALLED.\"\n+\telse # normal case, use source version of gitweb\n+\t\tSCRIPT_NAME=\"$GIT_BUILD_DIR/gitweb/gitweb.perl\"\n+\tfi\n+\texport SCRIPT_NAME\n }\n \n gitweb_run () {\n \tGATEWAY_INTERFACE='CGI/1.1'\n \tHTTP_ACCEPT='*/*'\n \tREQUEST_METHOD='GET'\n-\tSCRIPT_NAME=\"$GIT_BUILD_DIR/gitweb/gitweb.perl\"\n \tQUERY_STRING=\"\"$1\"\"\n \tPATH_INFO=\"\"$2\"\"\n \texport GATEWAY_INTERFACE HTTP_ACCEPT REQUEST_METHOD \\\n-\t\tSCRIPT_NAME QUERY_STRING PATH_INFO\n+\t\tQUERY_STRING PATH_INFO\n \n \tGITWEB_CONFIG=$(pwd)/gitweb_config.perl\n \texport GITWEB_CONFIG\n-- \n1.7.2.1\n"}]}