{"thread":{"id":"23814","subject":"[PATCHv2 GSoC 1/3] gitweb: Set default destination directory for installing gitweb in Makefile","startedAt":"2010-05-15T19:58:38Z","lastAt":"2010-05-19T16:48:47Z","messageCount":12,"participants":["Pavan Kumar Sunkara","Dévai Tamás","Erik Faye-Lund","Jakub Narebski","Eric Wong"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"141741","messageId":"1273953520-25990-1-git-send-email-pavan.sss1991@gmail.com","threadId":"23814","inReplyTo":null,"subject":"[PATCHv2 GSoC 1/3] gitweb: Set default destination directory for installing gitweb in Makefile","fromName":"Pavan Kumar Sunkara","fromEmail":"pavan.sss1991@gmail.com","sentAt":"2010-05-15T19:58:38Z","receivedAt":"2010-05-15T19:58:38Z","isPatch":false,"sender":{"key":"pavan.sss1991@gmail.com","avatar":"https://avatars.githubusercontent.com/u/174703?v=4"},"body":"Currently installing gitweb requires to give a target directory\n(via 'gitwebdir' build variable).  Giving it a default value\nprotects against user errors.\n\nSigned-off-by: Pavan Kumar Sunkara <pavan.sss1991@gmail.com>\n---\n Makefile |    1 +\n 1 files changed, 1 insertions(+), 0 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex de7f680..caf2f64 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -269,6 +269,7 @@ mandir = share/man\n infodir = share/info\n gitexecdir = libexec/git-core\n sharedir = $(prefix)/share\n+gitwebdir = $(sharedir)/gitweb\n template_dir = share/git-core/templates\n htmldir = share/doc/git-doc\n ifeq ($(prefix),/usr)\n-- \n1.7.1.16.g5d405c.dirty\n"},{"id":"141742","messageId":"1273953520-25990-2-git-send-email-pavan.sss1991@gmail.com","threadId":"23814","inReplyTo":"1273953520-25990-1-git-send-email-pavan.sss1991@gmail.com","subject":"[PATCH GSoC 2/3] git-instaweb: Configure it to work with a global server root and projects list","fromName":"Pavan Kumar Sunkara","fromEmail":"pavan.sss1991@gmail.com","sentAt":"2010-05-15T19:58:39Z","receivedAt":"2010-05-15T19:58:39Z","isPatch":true,"sender":{"key":"pavan.sss1991@gmail.com","avatar":"https://avatars.githubusercontent.com/u/174703?v=4"},"body":"git-instaweb in its current form (re)creates gitweb.cgi and\n(some of) required static files in $GIT_DIR/gitweb/ directory for\neach repository it is ran. Splitting gitweb would make it difficult\nfor git-instaweb to continue with this method.\n\nUse the instaweb.root config variable to point git-instaweb script\nto a global directory which contains gitweb files as server root\nand the httpd.conf along with server logs and pid go into\n'$(HOME)/.gitweb' directory.\n\nAs there is no need to call git-instaweb in every git repository,\nconfigure gitweb to get $projects_list from file '$(HOME)/.gitweb/list'\nand $projectroot is ''\n\nExample of ~/.gitweb/list:\nhome%2Fpavan%2Fgit%2F.git Linus+Torvalds\nhome%2Fpavan%2Fgsoc%2F.git Pavan+Kumar+Sunkara\n\nSigned-off-by: Pavan Kumar Sunkara <pavan.sss1991@gmail.com>\n---\n Makefile        |    9 +----\n git-instaweb.sh |  100 ++++++++++++++++++-------------------------------------\n 2 files changed, 34 insertions(+), 75 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex caf2f64..1e9fb77 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -1592,15 +1592,7 @@ git-instaweb: git-instaweb.sh gitweb/gitweb.cgi gitweb/static/gitweb.css gitweb/\n \tsed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \\\n \t    -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \\\n \t    -e 's/@@NO_CURL@@/$(NO_CURL)/g' \\\n-\t    -e '/@@GITWEB_CGI@@/r gitweb/gitweb.cgi' \\\n-\t    -e '/@@GITWEB_CGI@@/d' \\\n-\t    -e '/@@GITWEB_CSS@@/r $(GITWEB_CSS)' \\\n-\t    -e '/@@GITWEB_CSS@@/d' \\\n-\t    -e '/@@GITWEB_JS@@/r $(GITWEB_JS)' \\\n-\t    -e '/@@GITWEB_JS@@/d' \\\n \t    -e 's|@@PERL@@|$(PERL_PATH_SQ)|g' \\\n-            -e 's|@@GITWEB_CSS_NAME@@|$(GITWEB_CSS)|' \\\n-            -e 's|@@GITWEB_JS_NAME@@|$(GITWEB_JS)|' \\\n \t    $@.sh > $@+ && \\\n \tchmod +x $@+ && \\\n \tmv $@+ $@\n@@ -1972,6 +1964,7 @@ install: all\n \t$(MAKE) -C templates DESTDIR='$(DESTDIR_SQ)' install\n ifndef NO_PERL\n \t$(MAKE) -C perl prefix='$(prefix_SQ)' DESTDIR='$(DESTDIR_SQ)' install\n+\t$(MAKE) -C gitweb gitwebdir=$(gitwebdir) GITWEB_LIST=$(HOME)/.gitweb/list GITWEB_PROJECTROOT='' install\n endif\n ifndef NO_PYTHON\n \t$(MAKE) -C git_remote_helpers prefix='$(prefix_SQ)' DESTDIR='$(DESTDIR_SQ)' install\ndiff --git a/git-instaweb.sh b/git-instaweb.sh\nindex f608014..4aaacbb 100755\n--- a/git-instaweb.sh\n+++ b/git-instaweb.sh\n@@ -19,21 +19,30 @@ start          start the web server\n restart        restart the web server\n \"\n \n+# This must be capable of running outside of git directory, so\n+# the vanilla git-sh-setup should not be used.\n+NONGIT_OK=Yes\n . git-sh-setup\n \n-fqgitdir=\"$GIT_DIR\"\n+fqgitdir=\"$HOME/.gitweb\"\n local=\"$(git config --bool --get instaweb.local)\"\n httpd=\"$(git config --get instaweb.httpd)\"\n+root=\"$(git config --get instaweb.root)\" \n port=$(git config --get instaweb.port)\n module_path=\"$(git config --get instaweb.modulepath)\"\n \n-conf=\"$GIT_DIR/gitweb/httpd.conf\"\n+mkdir -p \"$fqgitdir/tmp\"\n+test ! -w \"$fqgitdir/list\" && touch \"$fqgitdir/list\"\n+conf=\"$fqgitdir/httpd.conf\"\n \n # Defaults:\n \n # if installed, it doesn't need further configuration (module_path)\n test -z \"$httpd\" && httpd='lighttpd -f'\n \n+# Default is /usr/share/gitweb\n+test -z \"$root\" && root='/usr/share/gitweb'\n+\n # any untaken local port will do...\n test -z \"$port\" && port=1234\n \n@@ -56,8 +65,8 @@ resolve_full_httpd () {\n \t\t# many httpds are installed in /usr/sbin or /usr/local/sbin\n \t\t# these days and those are not in most users $PATHs\n \t\t# in addition, we may have generated a server script\n-\t\t# in $fqgitdir/gitweb.\n-\t\tfor i in /usr/local/sbin /usr/sbin \"$fqgitdir/gitweb\"\n+\t\t# in $fqgitdir.\n+\t\tfor i in /usr/local/sbin /usr/sbin \"$fqgitdir\"\n \t\tdo\n \t\t\tif test -x \"$i/$httpd_only\"\n \t\t\tthen\n@@ -85,7 +94,7 @@ start_httpd () {\n \tcase \"$httpd\" in\n \t*mongoose*)\n \t\t#The mongoose server doesn't have a daemon mode so we'll have to fork it\n-\t\t$full_httpd \"$fqgitdir/gitweb/httpd.conf\" &\n+\t\t$full_httpd \"$conf\" &\n \t\t#Save the pid before doing anything else (we'll print it later)\n \t\tpid=$!\n \n@@ -99,7 +108,7 @@ $pid\n EOF\n \t\t;;\n \t*)\n-\t\t$full_httpd \"$fqgitdir/gitweb/httpd.conf\"\n+\t\t$full_httpd \"$conf\"\n \t\tif test $? != 0; then\n \t\t\techo \"Could not execute http daemon $httpd.\"\n \t\t\texit 1\n@@ -156,15 +165,9 @@ do\n \tshift\n done\n \n-mkdir -p \"$GIT_DIR/gitweb/tmp\"\n-GIT_EXEC_PATH=\"$(git --exec-path)\"\n-GIT_DIR=\"$fqgitdir\"\n-export GIT_EXEC_PATH GIT_DIR\n-\n-\n webrick_conf () {\n \t# generate a standalone server script in $fqgitdir/gitweb.\n-\tcat >\"$fqgitdir/gitweb/$httpd.rb\" <<EOF\n+\tcat >\"$fqgitdir/$httpd.rb\" <<EOF\n require 'webrick'\n require 'yaml'\n options = YAML::load_file(ARGV[0])\n@@ -184,15 +187,15 @@ EOF\n \t# which assumes _ruby_ is in the user's $PATH. that's _one_\n \t# portable way to run ruby, which could be installed anywhere,\n \t# really.\n-\tcat >\"$fqgitdir/gitweb/$httpd\" <<EOF\n+\tcat >\"$fqgitdir/$httpd\" <<EOF\n #!/bin/sh\n-exec ruby \"$fqgitdir/gitweb/$httpd.rb\" \\$*\n+exec ruby \"$fqgitdir/$httpd.rb\" \\$*\n EOF\n-\tchmod +x \"$fqgitdir/gitweb/$httpd\"\n+\tchmod +x \"$fqgitdir/$httpd\"\n \n \tcat >\"$conf\" <<EOF\n :Port: $port\n-:DocumentRoot: \"$fqgitdir/gitweb\"\n+:DocumentRoot: \"$root\"\n :DirectoryIndex: [\"gitweb.cgi\"]\n :PidFile: \"$fqgitdir/pid\"\n EOF\n@@ -201,16 +204,16 @@ EOF\n \n lighttpd_conf () {\n \tcat > \"$conf\" <<EOF\n-server.document-root = \"$fqgitdir/gitweb\"\n+server.document-root = \"$root\"\n server.port = $port\n server.modules = ( \"mod_setenv\", \"mod_cgi\" )\n server.indexfiles = ( \"gitweb.cgi\" )\n server.pid-file = \"$fqgitdir/pid\"\n-server.errorlog = \"$fqgitdir/gitweb/error.log\"\n+server.errorlog = \"$fqgitdir/error.log\"\n \n # to enable, add \"mod_access\", \"mod_accesslog\" to server.modules\n # variable above and uncomment this\n-#accesslog.filename = \"$fqgitdir/gitweb/access.log\"\n+#accesslog.filename = \"$fqgitdir/access.log\"\n \n setenv.add-environment = ( \"PATH\" => env.PATH )\n \n@@ -277,14 +280,15 @@ EOF\n \n apache2_conf () {\n \ttest -z \"$module_path\" && module_path=/usr/lib/apache2/modules\n-\tmkdir -p \"$GIT_DIR/gitweb/logs\"\n \tbind=\n \ttest x\"$local\" = xtrue && bind='127.0.0.1:'\n \techo 'text/css css' > \"$fqgitdir/mime.types\"\n \tcat > \"$conf\" <<EOF\n ServerName \"git-instaweb\"\n-ServerRoot \"$fqgitdir/gitweb\"\n-DocumentRoot \"$fqgitdir/gitweb\"\n+ServerRoot \"$root\"\n+DocumentRoot \"$root\"\n+ErrorLog \"$fqgitdir/error.log\"\n+CustomLog \"$fqgitdir/access.log\" combined\n PidFile \"$fqgitdir/pid\"\n Listen $bind$port\n EOF\n@@ -303,13 +307,11 @@ EOF\n \t# check to see if Dennis Stosberg's mod_perl compatibility patch\n \t# (<20060621130708.Gcbc6e5c@leonov.stosberg.net>) has been applied\n \tif test -f \"$module_path/mod_perl.so\" &&\n-\t   sane_grep 'MOD_PERL' \"$GIT_DIR/gitweb/gitweb.cgi\" >/dev/null\n+\t   sane_grep 'MOD_PERL' \"$root/gitweb.cgi\" >/dev/null\n \tthen\n \t\t# favor mod_perl if available\n \t\tcat >> \"$conf\" <<EOF\n LoadModule perl_module $module_path/mod_perl.so\n-PerlPassEnv GIT_DIR\n-PerlPassEnv GIT_EXEC_DIR\n <Location /gitweb.cgi>\n \tSetHandler perl-script\n \tPerlResponseHandler ModPerl::Registry\n@@ -353,15 +355,15 @@ mongoose_conf() {\n # For detailed description of every option, visit\n # http://code.google.com/p/mongoose/wiki/MongooseManual\n \n-root\t\t$fqgitdir/gitweb\n+root\t\t$root\n ports\t\t$port\n index_files\tgitweb.cgi\n-#ssl_cert\t$fqgitdir/gitweb/ssl_cert.pem\n-error_log\t$fqgitdir/gitweb/error.log\n-access_log\t$fqgitdir/gitweb/access.log\n+#ssl_cert\t$fqgitdir/ssl_cert.pem\n+error_log\t$fqgitdir/error.log\n+access_log\t$fqgitdir/access.log\n \n #cgi setup\n-cgi_env\t\tPATH=$PATH,GIT_DIR=$GIT_DIR,GIT_EXEC_PATH=$GIT_EXEC_PATH\n+cgi_env\t\tPATH=$PATH\n cgi_interp\t$PERL\n cgi_ext\t\tcgi,pl\n \n@@ -370,42 +372,6 @@ mime_types\t.gz=application/x-gzip,.tar.gz=application/x-tgz,.tgz=application/x-t\n EOF\n }\n \n-\n-script='\n-s#^(my|our) \\$projectroot =.*#$1 \\$projectroot = \"'$(dirname \"$fqgitdir\")'\";#;\n-s#(my|our) \\$gitbin =.*#$1 \\$gitbin = \"'$GIT_EXEC_PATH'\";#;\n-s#(my|our) \\$projects_list =.*#$1 \\$projects_list = \\$projectroot;#;\n-s#(my|our) \\$git_temp =.*#$1 \\$git_temp = \"'$fqgitdir/gitweb/tmp'\";#;'\n-\n-gitweb_cgi () {\n-\tcat > \"$1.tmp\" <<\\EOFGITWEB\n-@@GITWEB_CGI@@\n-EOFGITWEB\n-\t# Use the configured full path to perl to match the generated\n-\t# scripts' 'hashpling' line\n-\t\"$PERL\" -p -e \"$script\" \"$1.tmp\"  > \"$1\"\n-\tchmod +x \"$1\"\n-\trm -f \"$1.tmp\"\n-}\n-\n-gitweb_css () {\n-\tcat > \"$1\" <<\\EOFGITWEB\n-@@GITWEB_CSS@@\n-\n-EOFGITWEB\n-}\n-\n-gitweb_js () {\n-\tcat > \"$1\" <<\\EOFGITWEB\n-@@GITWEB_JS@@\n-\n-EOFGITWEB\n-}\n-\n-gitweb_cgi \"$GIT_DIR/gitweb/gitweb.cgi\"\n-gitweb_css \"$GIT_DIR/@@GITWEB_CSS_NAME@@\"\n-gitweb_js  \"$GIT_DIR/@@GITWEB_JS_NAME@@\"\n-\n case \"$httpd\" in\n *lighttpd*)\n \tlighttpd_conf\n-- \n1.7.1.16.g5d405c.dirty\n"},{"id":"141743","messageId":"1273953520-25990-3-git-send-email-pavan.sss1991@gmail.com","threadId":"23814","inReplyTo":"1273953520-25990-1-git-send-email-pavan.sss1991@gmail.com","subject":"[PATCH 3/3] git-web--browse: Add support for google chrome","fromName":"Pavan Kumar Sunkara","fromEmail":"pavan.sss1991@gmail.com","sentAt":"2010-05-15T19:58:40Z","receivedAt":"2010-05-15T19:58:40Z","isPatch":true,"sender":{"key":"pavan.sss1991@gmail.com","avatar":"https://avatars.githubusercontent.com/u/174703?v=4"},"body":"Add support for another web browser called chrome. To\nselect it, the value of the browser should be 'chromium'.\n\nSigned-off-by: Pavan Kumar Sunkara <pavan.sss1991@gmail.com>\n---\n git-web--browse.sh |    9 +++++++--\n 1 files changed, 7 insertions(+), 2 deletions(-)\n\ndiff --git a/git-web--browse.sh b/git-web--browse.sh\nindex a578c3a..72dde3b 100755\n--- a/git-web--browse.sh\n+++ b/git-web--browse.sh\n@@ -31,7 +31,7 @@ valid_custom_tool()\n \n valid_tool() {\n \tcase \"$1\" in\n-\t\tfirefox | iceweasel | konqueror | w3m | links | lynx | dillo | open | start)\n+\t\tfirefox | iceweasel | chromium | konqueror | w3m | links | lynx | dillo | open | start)\n \t\t\t;; # happy\n \t\t*)\n \t\t\tvalid_custom_tool \"$1\" || return 1\n@@ -103,7 +103,7 @@ fi\n \n if test -z \"$browser\" ; then\n     if test -n \"$DISPLAY\"; then\n-\tbrowser_candidates=\"firefox iceweasel konqueror w3m links lynx dillo\"\n+\tbrowser_candidates=\"firefox iceweasel chromium konqueror w3m links lynx dillo\"\n \tif test \"$KDE_FULL_SESSION\" = \"true\"; then\n \t    browser_candidates=\"konqueror $browser_candidates\"\n \tfi\n@@ -146,6 +146,11 @@ case \"$browser\" in\n \ttest \"$vers\" -lt 2 && NEWTAB=''\n \t\"$browser_path\" $NEWTAB \"$@\" &\n \t;;\n+    chromium)\n+\t# Actual command for chromium is chromium-browser.\n+\t# No need to specify newTab. It's default in chromium\n+\teval \"$browser_path-browser\" \"$@\" &\n+\t;;\n     konqueror)\n \tcase \"$(basename \"$browser_path\")\" in\n \t    konqueror)\n-- \n1.7.1.16.g5d405c.dirty\n"},{"id":"141751","messageId":"1273969019.1169.16.camel@localhost.localdomain","threadId":"23814","inReplyTo":"1273953520-25990-2-git-send-email-pavan.sss1991@gmail.com","subject":"Re: [PATCH GSoC 2/3] git-instaweb: Configure it to work with a global server root and projects list","fromName":"Dévai Tamás","fromEmail":"devait@vnet.hu","sentAt":"2010-05-16T00:16:58Z","receivedAt":"2010-05-16T00:16:58Z","isPatch":true,"sender":{"key":"devait@vnet.hu","avatar":null},"body":"> +# Default is /usr/share/gitweb\n> +test -z \"$root\" && root='/usr/share/gitweb'\n\nJust one question: what happens, when one installs to /usr/local (or any\nother directory) instead of /usr? I'd use the $(gitwebdir) variable from\nthe Makefile as default, such as\n\n  # if installed, it doesn't need further configuration (module_path)\n  test -z \"$httpd\" && httpd='lighttpd -f'\n  \n-+# Default is /usr/share/gitweb\n-+test -z \"$root\" && root='/usr/share/gitweb'\n++# Default is @@gitwebdir@@\n++test -z \"$root\" && root='@@gitwebdir@@'\n +\n  # any untaken local port will do...\n  test -z \"$port\" && port=1234\n\nand in the Makefile\n\n         sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \\\n             -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \\\n             -e 's/@@NO_CURL@@/$(NO_CURL)/g' \\\n++           -e 's|@@gitwebdir@@|$(gitwebdir)|g' \\\n -           -e '/@@GITWEB_CGI@@/r gitweb/gitweb.cgi' \\\n -           -e '/@@GITWEB_CGI@@/d' \\\n -           -e '/@@GITWEB_CSS@@/r $(GITWEB_CSS)' \\\n\nHope that you find it reasonable.\n--\nDévai Tamás\n"},{"id":"141781","messageId":"AANLkTikksDF9Ph0ww2yjKBpEOpFxL3kplSRxEM0II7CF@mail.gmail.com","threadId":"23814","inReplyTo":"1273953520-25990-3-git-send-email-pavan.sss1991@gmail.com","subject":"Re: [PATCH 3/3] git-web--browse: Add support for google chrome","fromName":"Erik Faye-Lund","fromEmail":"kusmabite@googlemail.com","sentAt":"2010-05-16T21:01:26Z","receivedAt":"2010-05-16T21:01:26Z","isPatch":true,"sender":{"key":"kusmabite@gmail.com","avatar":"https://avatars.githubusercontent.com/u/47073?v=4"},"body":"On Sat, May 15, 2010 at 9:58 PM, Pavan Kumar Sunkara\n<pavan.sss1991@gmail.com> wrote:\n> Add support for another web browser called chrome. To\n> select it, the value of the browser should be 'chromium'.\n\nSince we already have firefox AND iceweasel, wouldn't it make sense to\nadd chrome AND chromium?\n\n-- \nErik \"kusma\" Faye-Lund\n"},{"id":"141838","messageId":"AANLkTinj6sgWDm6yUVDCT6kwg-bcQRh1QCSlyLjEFtls@mail.gmail.com","threadId":"23814","inReplyTo":"1273969019.1169.16.camel@localhost.localdomain","subject":"Re: [PATCH GSoC 2/3] git-instaweb: Configure it to work with a global server root and projects list","fromName":"Pavan Kumar Sunkara","fromEmail":"pavan.sss1991@gmail.com","sentAt":"2010-05-17T20:22:37Z","receivedAt":"2010-05-17T20:22:37Z","isPatch":true,"sender":{"key":"pavan.sss1991@gmail.com","avatar":"https://avatars.githubusercontent.com/u/174703?v=4"},"body":"Thanks Devai. It's great.\n\n- pavan\n\nOn Sun, May 16, 2010 at 5:46 AM, Dévai Tamás <devait@vnet.hu> wrote:\n>> +# Default is /usr/share/gitweb\n>> +test -z \"$root\" && root='/usr/share/gitweb'\n>\n> Just one question: what happens, when one installs to /usr/local (or any\n> other directory) instead of /usr? I'd use the $(gitwebdir) variable from\n> the Makefile as default, such as\n>\n>  # if installed, it doesn't need further configuration (module_path)\n>  test -z \"$httpd\" && httpd='lighttpd -f'\n>\n> -+# Default is /usr/share/gitweb\n> -+test -z \"$root\" && root='/usr/share/gitweb'\n> ++# Default is @@gitwebdir@@\n> ++test -z \"$root\" && root='@@gitwebdir@@'\n>  +\n>  # any untaken local port will do...\n>  test -z \"$port\" && port=1234\n>\n> and in the Makefile\n>\n>         sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \\\n>             -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \\\n>             -e 's/@@NO_CURL@@/$(NO_CURL)/g' \\\n> ++           -e 's|@@gitwebdir@@|$(gitwebdir)|g' \\\n>  -           -e '/@@GITWEB_CGI@@/r gitweb/gitweb.cgi' \\\n>  -           -e '/@@GITWEB_CGI@@/d' \\\n>  -           -e '/@@GITWEB_CSS@@/r $(GITWEB_CSS)' \\\n>\n> Hope that you find it reasonable.\n> --\n> Dévai Tamás\n>\n>\n"},{"id":"141861","messageId":"m3ljbhcp46.fsf@localhost.localdomain","threadId":"23814","inReplyTo":"1273953520-25990-2-git-send-email-pavan.sss1991@gmail.com","subject":"Re: [PATCH GSoC 2/3] git-instaweb: Configure it to work with a global server root and projects list","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2010-05-18T13:33:00Z","receivedAt":"2010-05-18T13:33:00Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Cc-ed to Eric Wond, main author and maintainer of git-instaweb.\n\nPavan Kumar Sunkara <pavan.sss1991@gmail.com> writes:\n\n> git-instaweb in its current form (re)creates gitweb.cgi and\n> (some of) required static files in $GIT_DIR/gitweb/ directory for\n> each repository it is ran. Splitting gitweb would make it difficult\n> for git-instaweb to continue with this method.\n\nI agree with that.\n\n(By the way, I really like this paragraph of commit mesage, which is\nintroduction to a commit, describing current situation and problems\nwith it.)\n\n> \n> Use the instaweb.root config variable to point git-instaweb script\n> to a global directory which contains gitweb files as server root\n\nA nitpick about style of grammar of this commit message: there should\nbe fullstop here, ending sentence.\n\nWhile I can agree with `instaweb.root' config variable to *override*\nthe default, it should have sane default, and setting it should be not\nrequired to be able to run git-instaweb.  Therefore the 'install'\ntarget of main Makefile should either:\na.) install gitweb into gitdir=$(sharedir)/gitweb, and make \n    instaweb.root be $(sharedir)/gitweb by default\nb.) install gitweb into $(gitwebdir), which only have $(sharedir)/gitweb\n    as default, and embed $(gitwebdir) in git-instaweb script when \n    building, so that it would be default value of instaweb.root\n\nThis would probably mean replacing either @@sharedir@@ or @@gitwebdir@@\nplaceholders in git-instaweb.sh when building git-instaweb.\n\n> and the httpd.conf along with server logs and pid go into\n> '$(HOME)/.gitweb' directory.\n> \n> As there is no need to call git-instaweb in every git repository,\n> configure gitweb to get $projects_list from file '$(HOME)/.gitweb/list'\n> and $projectroot is ''\n> \n> Example of ~/.gitweb/list:\n> home%2Fpavan%2Fgit%2F.git Linus+Torvalds\n> home%2Fpavan%2Fgsoc%2F.git Pavan+Kumar+Sunkara\n\nThis is quite a large change on how git-instaweb works.\n\nFirst, I think such change should be better left for a separate\ncommit, splitting this one in two: one making git-instaweb use\ninstalled gitweb files, and installing gitweb files somewhere when\ninstalling git, and second changing how git-instaweb behave.\n\"Do one thing, and do it well.\"  It would make easier to check\nif there are errors in the commit.\n\nSecond, in my opinion it is not a good change at all.  Currently you\ncan run \"git instaweb\" when inside git repository, and get a web\nbrowser (or a new tab in existing session of a running web browser)\nwith current repository in it, to browse its history.  It is similar\nto running gitk (or other graphical history browser, like qgit, tig,\netc.), or running \"git log\", but with web interface.\n\nNow, current git-instaweb behavior has its quirks, but having\ngit-instaweb show _current_ repository is a very important feature,\nand I'd rather we didn't lose it in transition.\n\nSo in my opinion it would be better to just update git-instaweb and\ngenerating git-instaweb to make use of installed gitweb and installed\ngitweb files, but do not change organization of generated files; just\ninstead of gitweb.cgi there should be gitweb_config.perl with\nappropriate configuration to show current repository.  And of course\nthere would be no gitweb files in $GIT_DIR/gitweb (in .git/gitweb)\ndirectory.\n\n> \n> Signed-off-by: Pavan Kumar Sunkara <pavan.sss1991@gmail.com>\n> ---\n>  Makefile        |    9 +----\n>  git-instaweb.sh |  100 ++++++++++++++++++-------------------------------------\n>  2 files changed, 34 insertions(+), 75 deletions(-)\n> \n> diff --git a/Makefile b/Makefile\n> index caf2f64..1e9fb77 100644\n> --- a/Makefile\n> +++ b/Makefile\n> @@ -1592,15 +1592,7 @@ git-instaweb: git-instaweb.sh gitweb/gitweb.cgi gitweb/static/gitweb.css gitweb/\n>  \tsed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \\\n>  \t    -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \\\n>  \t    -e 's/@@NO_CURL@@/$(NO_CURL)/g' \\\n> -\t    -e '/@@GITWEB_CGI@@/r gitweb/gitweb.cgi' \\\n> -\t    -e '/@@GITWEB_CGI@@/d' \\\n> -\t    -e '/@@GITWEB_CSS@@/r $(GITWEB_CSS)' \\\n> -\t    -e '/@@GITWEB_CSS@@/d' \\\n> -\t    -e '/@@GITWEB_JS@@/r $(GITWEB_JS)' \\\n> -\t    -e '/@@GITWEB_JS@@/d' \\\n>  \t    -e 's|@@PERL@@|$(PERL_PATH_SQ)|g' \\\n\nGood to leave this change.\n\n> -            -e 's|@@GITWEB_CSS_NAME@@|$(GITWEB_CSS)|' \\\n> -            -e 's|@@GITWEB_JS_NAME@@|$(GITWEB_JS)|' \\\n\nHmmm... I winder why we had there indenting using spaces only, instead\nof initial tab here...  Doesn't matter for this commit, though.\n\n>  \t    $@.sh > $@+ && \\\n>  \tchmod +x $@+ && \\\n>  \tmv $@+ $@\n> @@ -1972,6 +1964,7 @@ install: all\n>  \t$(MAKE) -C templates DESTDIR='$(DESTDIR_SQ)' install\n>  ifndef NO_PERL\n>  \t$(MAKE) -C perl prefix='$(prefix_SQ)' DESTDIR='$(DESTDIR_SQ)' install\n> +\t$(MAKE) -C gitweb gitwebdir=$(gitwebdir) GITWEB_LIST=$(HOME)/.gitweb/list GITWEB_PROJECTROOT='' install\n\nThere is no need to pass \"gitwebdir=$(gitwebdir)\" to submakefile, I\nthink, but you should check that.  Anyway, it should be\n\n  +\t$(MAKE) -C gitweb gitwebdir=$(gitwebdir_SQ) ...\n\n\nSee also my comments about why change in git-instaweb behavior is not\ngood idea, especially not in this commit.  _Perhaps_ it should be\ninstead somthing like this:\n\n  +\t$(MAKE) -C gitweb gitwebdir=$(gitwebdir_SQ) \\\n  +\t\tGITWEB_CONFIG='$ENV{GIT_DIR}/gitweb/gitweb_config.perl' install\n\nOr something like that (not tested!)\n\n> diff --git a/git-instaweb.sh b/git-instaweb.sh\n> index f608014..4aaacbb 100755\n> --- a/git-instaweb.sh\n> +++ b/git-instaweb.sh\n> @@ -19,21 +19,30 @@ start          start the web server\n>  restart        restart the web server\n>  \"\n>  \n> +# This must be capable of running outside of git directory, so\n> +# the vanilla git-sh-setup should not be used.\n> +NONGIT_OK=Yes\n\nThis is related to the change in git-instaweb behavior.  IMVHO \n\"git instaweb\" should work just like \"git log\" or gitk, so requiring\nto be run from git repository is not a bad requirement.\n\n>  . git-sh-setup\n>  \n> -fqgitdir=\"$GIT_DIR\"\n> +fqgitdir=\"$HOME/.gitweb\"\n\nThis is related to the change in git-instaweb behavior.  Anyway, the\n'fqgitdir' name for this variable doesn't make much sense after this\nchange, isn't it?\n\n>  local=\"$(git config --bool --get instaweb.local)\"\n>  httpd=\"$(git config --get instaweb.httpd)\"\n> +root=\"$(git config --get instaweb.root)\" \n\nTrailing space.\n\nI'm not entirely happy with the name of this config variable.  Perhaps\ninstaweb.gitwebdir would be better?  Also, we have to make sure that\ngit-instaweb would work even if this config variable is unset; perhaps\nyou do this later.\n\n>  port=$(git config --get instaweb.port)\n>  module_path=\"$(git config --get instaweb.modulepath)\"\n>  \n> -conf=\"$GIT_DIR/gitweb/httpd.conf\"\n> +mkdir -p \"$fqgitdir/tmp\"\n> +test ! -w \"$fqgitdir/list\" && touch \"$fqgitdir/list\"\n> +conf=\"$fqgitdir/httpd.conf\"\n\nFirst, a functional change.\n\nSecond, \"mkdir -p\" is not portable, although I am not sure if it is a\nproblem in practice (i.e. if it is a problem on any platform that\ngi-instaweb works now).\n\nBut I see that git-instaweb used \"mkdir -p\" before...\n\n>  # Defaults:\n>  \n>  # if installed, it doesn't need further configuration (module_path)\n>  test -z \"$httpd\" && httpd='lighttpd -f'\n>  \n> +# Default is /usr/share/gitweb\n> +test -z \"$root\" && root='/usr/share/gitweb'\n> +\n\nIt should be either\n\n  +test -z \"$root\" && root='@@gitwebdir@@'\n\nor\n\n  +test -z \"$root\" && root='@@sharedir@@/gitweb'\n\n(with placeholders replaced by \"make git-instaweb\").\n\n> @@ -56,8 +65,8 @@ resolve_full_httpd () {\n>  \t\t# many httpds are installed in /usr/sbin or /usr/local/sbin\n>  \t\t# these days and those are not in most users $PATHs\n>  \t\t# in addition, we may have generated a server script\n> -\t\t# in $fqgitdir/gitweb.\n> -\t\tfor i in /usr/local/sbin /usr/sbin \"$fqgitdir/gitweb\"\n> +\t\t# in $fqgitdir.\n> +\t\tfor i in /usr/local/sbin /usr/sbin \"$fqgitdir\"\n\nI think we should *add* \"$root\" here, but not remove the feature that\nserver script might be generated in \"$GIT_DIR/gitweb\", i.e. in\n\"$fqgitdir\".  So the last line would be:\n\n  +\t\tfor i in /usr/local/sbin /usr/sbin \"$root\" \"$fqgitdir/gitweb\"\n\n>  \t\tdo\n>  \t\t\tif test -x \"$i/$httpd_only\"\n>  \t\t\tthen\n> @@ -85,7 +94,7 @@ start_httpd () {\n>  \tcase \"$httpd\" in\n>  \t*mongoose*)\n>  \t\t#The mongoose server doesn't have a daemon mode so we'll have to fork it\n> -\t\t$full_httpd \"$fqgitdir/gitweb/httpd.conf\" &\n> +\t\t$full_httpd \"$conf\" &\n>  \t\t#Save the pid before doing anything else (we'll print it later)\n>  \t\tpid=$!\n>  \n\nThis is change in how git-instaweb works.  Mind you, perhaps *this*\npart of change is good... but not in this commit.\n\nWe might want to introduce $fqconf variable in preparatory commit...\n\n> @@ -99,7 +108,7 @@ $pid\n>  EOF\n>  \t\t;;\n>  \t*)\n> -\t\t$full_httpd \"$fqgitdir/gitweb/httpd.conf\"\n> +\t\t$full_httpd \"$conf\"\n>  \t\tif test $? != 0; then\n>  \t\t\techo \"Could not execute http daemon $httpd.\"\n>  \t\t\texit 1\n\nSame as above.\n\n> @@ -156,15 +165,9 @@ do\n>  \tshift\n>  done\n>  \n> -mkdir -p \"$GIT_DIR/gitweb/tmp\"\n\nAh, I see that git-instaweb used \"mkdir -p\" before...\n\n>  \tcat >\"$conf\" <<EOF\n>  :Port: $port\n> -:DocumentRoot: \"$fqgitdir/gitweb\"\n> +:DocumentRoot: \"$root\"\n\n> -server.document-root = \"$fqgitdir/gitweb\"\n> +server.document-root = \"$root\"\n\n> -ServerRoot \"$fqgitdir/gitweb\"\n> -DocumentRoot \"$fqgitdir/gitweb\"\n> +ServerRoot \"$root\"\n> +DocumentRoot \"$root\"\n\n> -root\t\t$fqgitdir/gitweb\n> +root\t\t$root\n\nGood.\n\nAh, I see, that is why instaweb.root name for config variable, and\n$root name for variable in git-instaweb script... but 'root' meaning\n'DocumentRoot' makes sense *only* in context.  That is why\ninstaweb.root is not IMHO a good name.\n\nI am not against $root as name of variable, because it is hidden, and\nis invariably in the context ;-)\n\n> -server.errorlog = \"$fqgitdir/gitweb/error.log\"\n> +server.errorlog = \"$fqgitdir/error.log\"\n>  \n>  # to enable, add \"mod_access\", \"mod_accesslog\" to server.modules\n>  # variable above and uncomment this\n> -#accesslog.filename = \"$fqgitdir/gitweb/access.log\"\n> +#accesslog.filename = \"$fqgitdir/access.log\"\n\nWithout change in how git-instaweb work, i.e. with separate server\ninvoked for each repository (it might be a thing that we want to\nchange, but again: not in this commit), it makes sense to also have\nerror log and access log separate for each repository.\n\nWe could have used $fqgitwebdir variable here, or something like that.\n\n>  apache2_conf () {\n>  \ttest -z \"$module_path\" && module_path=/usr/lib/apache2/modules\n> -\tmkdir -p \"$GIT_DIR/gitweb/logs\"\n>  \tbind=\n>  \ttest x\"$local\" = xtrue && bind='127.0.0.1:'\n>  \techo 'text/css css' > \"$fqgitdir/mime.types\"\n>  \tcat > \"$conf\" <<EOF\n>  ServerName \"git-instaweb\"\n> +ErrorLog \"$fqgitdir/error.log\"\n> +CustomLog \"$fqgitdir/access.log\" combined\n>  PidFile \"$fqgitdir/pid\"\n>  Listen $bind$port\n>  EOF\n\nIs this something new?  Did apache2 produced error log and access log\nbefore this?\n\nIf it is something new, it should be put in separate (probably\npreparatory) commit.\n\n> @@ -303,13 +307,11 @@ EOF\n>  \t# check to see if Dennis Stosberg's mod_perl compatibility patch\n>  \t# (<20060621130708.Gcbc6e5c@leonov.stosberg.net>) has been applied\n>  \tif test -f \"$module_path/mod_perl.so\" &&\n> -\t   sane_grep 'MOD_PERL' \"$GIT_DIR/gitweb/gitweb.cgi\" >/dev/null\n> +\t   sane_grep 'MOD_PERL' \"$root/gitweb.cgi\" >/dev/null\n\nSidenote: I gues that this check could be removed now, but this is an\nindependent change.\n\n>  \tthen\n>  \t\t# favor mod_perl if available\n>  \t\tcat >> \"$conf\" <<EOF\n>  LoadModule perl_module $module_path/mod_perl.so\n> -PerlPassEnv GIT_DIR\n> -PerlPassEnv GIT_EXEC_DIR\n\nIn a minimal patch, the one that doesn't change git-instaweb\nbehaviour, and simply creates gitweb_config.perl in $GIT_DIR/gitweb in\nplace of gitweb.cgi and gitweb files, we would not want to remove\nthose two lines, but add instead\n\n  +PerlPassEnv GITWEB_CONFIG\n\n>  #cgi setup\n> -cgi_env\t\tPATH=$PATH,GIT_DIR=$GIT_DIR,GIT_EXEC_PATH=$GIT_EXEC_PATH\n> +cgi_env\t\tPATH=$PATH\n>  cgi_interp\t$PERL\n>  cgi_ext\t\tcgi,pl\n\nSimilarly, append ',GITWEB_CONFIG=$GITWEB_CONFIG' here.\n\n> -script='\n> -s#^(my|our) \\$projectroot =.*#$1 \\$projectroot = \"'$(dirname \"$fqgitdir\")'\";#;\n> -s#(my|our) \\$gitbin =.*#$1 \\$gitbin = \"'$GIT_EXEC_PATH'\";#;\n> -s#(my|our) \\$projects_list =.*#$1 \\$projects_list = \\$projectroot;#;\n> -s#(my|our) \\$git_temp =.*#$1 \\$git_temp = \"'$fqgitdir/gitweb/tmp'\";#;'\n> -\n> -gitweb_cgi () {\n[...]\n> -gitweb_cgi \"$GIT_DIR/gitweb/gitweb.cgi\"\n> -gitweb_css \"$GIT_DIR/@@GITWEB_CSS_NAME@@\"\n> -gitweb_js  \"$GIT_DIR/@@GITWEB_JS_NAME@@\"\n\nThis should be in my opinion replaced by generating proper\ngitweb_config.perl file in $GIT_DIR/gitweb, and setting GITWEB_CONFIG\nvariable before running web server.\n\n\nP.S. As the main goal of your GSoC project is create web interface\nequivalent of git-gui (like gitweb is web interface equivalent of\ngitk), with a secondary goal of splitting gitweb to make it easy to\nadd such new functionality without losing maintability, I think you\nshould not concentrate on this part.\n\n-- \nJakub Narebski\nPoland\nShadeHawk on #git\n"},{"id":"141876","messageId":"AANLkTilhdkw7v-jV9JNBx8qvGBCenieExRh_zVm3hAKq@mail.gmail.com","threadId":"23814","inReplyTo":"m3ljbhcp46.fsf@localhost.localdomain","subject":"Re: [PATCH GSoC 2/3] git-instaweb: Configure it to work with a global server root and projects list","fromName":"Pavan Kumar Sunkara","fromEmail":"pavan.sss1991@gmail.com","sentAt":"2010-05-18T18:56:25Z","receivedAt":"2010-05-18T18:56:25Z","isPatch":true,"sender":{"key":"pavan.sss1991@gmail.com","avatar":"https://avatars.githubusercontent.com/u/174703?v=4"},"body":"> While I can agree with `instaweb.root' config variable to *override*\n> the default, it should have sane default, and setting it should be not\n> required to be able to run git-instaweb.  Therefore the 'install'\n> target of main Makefile should either:\n> a.) install gitweb into gitdir=$(sharedir)/gitweb, and make\n>    instaweb.root be $(sharedir)/gitweb by default\n> b.) install gitweb into $(gitwebdir), which only have $(sharedir)/gitweb\n>    as default, and embed $(gitwebdir) in git-instaweb script when\n>    building, so that it would be default value of instaweb.root\n>\n> This would probably mean replacing either @@sharedir@@ or @@gitwebdir@@\n> placeholders in git-instaweb.sh when building git-instaweb.\n\nYeah I will do that.\n\n>> and the httpd.conf along with server logs and pid go into\n>> '$(HOME)/.gitweb' directory.\n>>\n>> As there is no need to call git-instaweb in every git repository,\n>> configure gitweb to get $projects_list from file '$(HOME)/.gitweb/list'\n>> and $projectroot is ''\n>>\n>> Example of ~/.gitweb/list:\n>> home%2Fpavan%2Fgit%2F.git Linus+Torvalds\n>> home%2Fpavan%2Fgsoc%2F.git Pavan+Kumar+Sunkara\n>\n> This is quite a large change on how git-instaweb works.\n>\n> First, I think such change should be better left for a separate\n> commit, splitting this one in two: one making git-instaweb use\n> installed gitweb files, and installing gitweb files somewhere when\n> installing git, and second changing how git-instaweb behave.\n> \"Do one thing, and do it well.\"  It would make easier to check\n> if there are errors in the commit.\n\nOk.\n\n> Second, in my opinion it is not a good change at all.  Currently you\n> can run \"git instaweb\" when inside git repository, and get a web\n> browser (or a new tab in existing session of a running web browser)\n> with current repository in it, to browse its history.  It is similar\n> to running gitk (or other graphical history browser, like qgit, tig,\n> etc.), or running \"git log\", but with web interface.\n\nYes. But this change is vital for the success of my GSoC project. I\nwill explain why.\nIf you remember, my GSoC project contains some functionalities like\ncreating/cloning repositories which need a server which need to start\noutside git directory.\n\nUntil now, I thought to use git-instaweb to do this. But I realised\nnow that it would be better if we have another script.\nSo we need to have a different \"git-client\" script which starts this client.\n\nWhat do you say ?\n\n> Now, current git-instaweb behavior has its quirks, but having\n> git-instaweb show _current_ repository is a very important feature,\n> and I'd rather we didn't lose it in transition.\n>\n> So in my opinion it would be better to just update git-instaweb and\n> generating git-instaweb to make use of installed gitweb and installed\n> gitweb files, but do not change organization of generated files; just\n> instead of gitweb.cgi there should be gitweb_config.perl with\n> appropriate configuration to show current repository.  And of course\n> there would be no gitweb files in $GIT_DIR/gitweb (in .git/gitweb)\n> directory.\n\nOk. Sure I will do it.\n\nThanks\n- Pavan\n"},{"id":"141892","messageId":"20100518225445.GA15414@dcvr.yhbt.net","threadId":"23814","inReplyTo":"m3ljbhcp46.fsf@localhost.localdomain","subject":"Re: [PATCH GSoC 2/3] git-instaweb: Configure it to work with a global server root and projects list","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2010-05-18T22:54:45Z","receivedAt":"2010-05-18T22:54:45Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Jakub Narebski <jnareb@gmail.com> wrote:\n> Second, in my opinion it is not a good change at all.  Currently you\n> can run \"git instaweb\" when inside git repository, and get a web\n> browser (or a new tab in existing session of a running web browser)\n> with current repository in it, to browse its history.  It is similar\n> to running gitk (or other graphical history browser, like qgit, tig,\n> etc.), or running \"git log\", but with web interface.\n> \n> Now, current git-instaweb behavior has its quirks, but having\n> git-instaweb show _current_ repository is a very important feature,\n> and I'd rather we didn't lose it in transition.\n\nI agree completely with Jakub here.  My original inspiration for\ninstaweb was being able to make local commits, fire up instaweb in my\nworking directory, and then to get a non-git-using cow-orker on my LAN\nto review some changes before I pushed them upstream.\n\nI'm no longer in a situation with non-git-using cow-orkers anymore, but\nI suspect many folks still are.\n\n-- \nEric Wong\n"},{"id":"141893","messageId":"201005190105.59606.jnareb@gmail.com","threadId":"23814","inReplyTo":"AANLkTilhdkw7v-jV9JNBx8qvGBCenieExRh_zVm3hAKq@mail.gmail.com","subject":"Re: [PATCH GSoC 2/3] git-instaweb: Configure it to work with a global server root and projects list","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2010-05-18T23:05:57Z","receivedAt":"2010-05-18T23:05:57Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"On Tue, 18 May 2010, Pavan Kumar Sunkara wrote:\n> Jakub Narebski wrote:\n>> Pavan Kumar Sunkara wrote:\n\n>>> and the httpd.conf along with server logs and pid go into\n>>> '$(HOME)/.gitweb' directory.\n>>>\n>>> As there is no need to call git-instaweb in every git repository,\n>>> configure gitweb to get $projects_list from file '$(HOME)/.gitweb/list'\n>>> and $projectroot is ''\n>>>\n>>> Example of ~/.gitweb/list:\n>>> home%2Fpavan%2Fgit%2F.git Linus+Torvalds\n>>> home%2Fpavan%2Fgsoc%2F.git Pavan+Kumar+Sunkara\n>>\n>> This is quite a large change on how git-instaweb works.\n>>\n>> First, I think such change should be better left for a separate\n>> commit, splitting this one in two: one making git-instaweb use\n>> installed gitweb files, and installing gitweb files somewhere when\n>> installing git, and second changing how git-instaweb behave.\n>> \"Do one thing, and do it well.\"  It would make easier to check\n>> if there are errors in the commit.\n> \n> Ok.\n> \n>> Second, in my opinion it is not a good change at all.  Currently you\n>> can run \"git instaweb\" when inside git repository, and get a web\n>> browser (or a new tab in existing session of a running web browser)\n>> with current repository in it, to browse its history.  It is similar\n>> to running gitk (or other graphical history browser, like qgit, tig,\n>> etc.), or running \"git log\", but with web interface.\n> \n> Yes. But this change is vital for the success of my GSoC project. I\n> will explain why.\n> If you remember, my GSoC project contains some functionalities like\n> creating/cloning repositories which need a server which need to start\n> outside git directory.\n> \n> Until now, I thought to use git-instaweb to do this. But I realised\n> now that it would be better if we have another script.\n> So we need to have a different \"git-client\" script which starts this client.\n> \n> What do you say ?\n\nWell, I can understand that.\n\nThere are two options how to resolve this issue without adding yet\nanother script (although on the other hand git-web-gui / git-client\ncould share code with git-instaweb just like git-difftool and \ngit-mergetool do).\n\nFirst is to leave git-instaweb similar to how it is now, with pid file,\nserver config file, gitweb config file, etc. in $GIT_DIR/gitweb, but\nif it is invoked outside any git repository, start it in \"repository\nadministration\" mode, i.e. on the page that allows one to create new\nrepository or clone repository.\n\nThe alternate solution would be to follow the idea implemented in this\npatch, namely per-user pid file, gitweb config file, server config file\netc. and the *list of projects* file in $HOME/.gitweb (or whenever\nXDG / FHS / LSB says it should be named), _but_ add an easy way to add\na new project (a new repositoey) to list.  Perhaps even make \n'git instaweb', when run from inside git repository, add automatically\ncurrent repository to list (unless it is present there already), and\nperhaps open 'summary' page for said repository.\n\nBut independently on which solution would be chosen, it should take place\nin a separate commit,\n> \n>> Now, current git-instaweb behavior has its quirks, but having\n>> git-instaweb show _current_ repository is a very important feature,\n>> and I'd rather we didn't lose it in transition.\n>>\n>> So in my opinion it would be better to just update git-instaweb and\n>> generating git-instaweb to make use of installed gitweb and installed\n>> gitweb files, but do not change organization of generated files; just\n>> instead of gitweb.cgi there should be gitweb_config.perl with\n>> appropriate configuration to show current repository.  And of course\n>> there would be no gitweb files in $GIT_DIR/gitweb (in .git/gitweb)\n>> directory.\n> \n> Ok. Sure I will do it.\n\nThanks in advance.\n-- \nJakub Narebski\nPoland\n"},{"id":"141900","messageId":"AANLkTimFrX6yE69ZNlZM11XJVNLS5rpbsdeNN984iNs7@mail.gmail.com","threadId":"23814","inReplyTo":"201005190105.59606.jnareb@gmail.com","subject":"Re: [PATCH GSoC 2/3] git-instaweb: Configure it to work with a global server root and projects list","fromName":"Pavan Kumar Sunkara","fromEmail":"pavan.sss1991@gmail.com","sentAt":"2010-05-19T08:58:54Z","receivedAt":"2010-05-19T08:58:54Z","isPatch":true,"sender":{"key":"pavan.sss1991@gmail.com","avatar":"https://avatars.githubusercontent.com/u/174703?v=4"},"body":">\n> Well, I can understand that.\n>\n> There are two options how to resolve this issue without adding yet\n> another script (although on the other hand git-web-gui / git-client\n> could share code with git-instaweb just like git-difftool and\n> git-mergetool do).\n>\n> First is to leave git-instaweb similar to how it is now, with pid file,\n> server config file, gitweb config file, etc. in $GIT_DIR/gitweb, but\n> if it is invoked outside any git repository, start it in \"repository\n> administration\" mode, i.e. on the page that allows one to create new\n> repository or clone repository.\n\nBut this solution requires starting of many apache servers on many\nports which is quite complicated and even messier.\n\n> The alternate solution would be to follow the idea implemented in this\n> patch, namely per-user pid file, gitweb config file, server config file\n> etc. and the *list of projects* file in $HOME/.gitweb (or whenever\n> XDG / FHS / LSB says it should be named), _but_ add an easy way to add\n> a new project (a new repositoey) to list.\n\nThe feature *Adding repository to client* in my project proposal will\ntake care of this.\n\n>  Perhaps even make\n> 'git instaweb', when run from inside git repository, add automatically\n> current repository to list (unless it is present there already), and\n> perhaps open 'summary' page for said repository.\n\nYeah, we can do that but I think I will do it in another commit.\n\n> But independently on which solution would be chosen, it should take place\n> in a separate commit,\n\nSo, I will implement the second solution but in seperate commit. First\nI will take care of this patch :)\n\nThanks\n- Pavan\n"},{"id":"141913","messageId":"201005191848.49922.jnareb@gmail.com","threadId":"23814","inReplyTo":"AANLkTimFrX6yE69ZNlZM11XJVNLS5rpbsdeNN984iNs7@mail.gmail.com","subject":"Re: [PATCH GSoC 2/3] git-instaweb: Configure it to work with a global server root and projects list","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2010-05-19T16:48:47Z","receivedAt":"2010-05-19T16:48:47Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"On Wed, 19 May 2010, Pavan Kumar Sunkara wrote:\n> On Wed, 19 May 2010 01:05:57 +0200, Jakub Narebski wrote:\n\n> > Well, I can understand that.\n> >\n> > There are two options how to resolve this issue without adding yet\n> > another script (although on the other hand git-web-gui / git-client\n> > could share code with git-instaweb just like git-difftool and\n> > git-mergetool do).\n> >\n> > First is to leave git-instaweb similar to how it is now, with pid file,\n> > server config file, gitweb config file, etc. in $GIT_DIR/gitweb, but\n> > if it is invoked outside any git repository, start it in \"repository\n> > administration\" mode, i.e. on the page that allows one to create new\n> > repository or clone repository.\n> \n> But this solution requires starting of many apache servers on many\n> ports which is quite complicated and even messier.\n\nI agree with that.  I guess that git-instaweb was created mainly for the\nsituation where you work in single repository, and does not support well\nsituation where you move from repository to repository, and run git-instaweb\nin different repositories.\n\n\nAs I wrote earlier:\n\n   Now, current git-instaweb behavior has its quirks, but having\n   git-instaweb show _current_ repository is a very important feature,\n   and I'd rather we didn't lose it in transition.\n\n> > The alternate solution would be to follow the idea implemented in this\n> > patch, namely per-user pid file, gitweb config file, server config file\n> > etc. and the *list of projects* file in $HOME/.gitweb (or whenever\n> > XDG / FHS / LSB says it should be named), _but_ add an easy way to add\n> > a new project (a new repositoey) to list.\n> \n> The feature *Adding repository to client* in my project proposal will\n> take care of this.\n\nThat's good, but...\n\n> >  Perhaps even make\n> > 'git instaweb', when run from inside git repository, add automatically\n> > current repository to list (unless it is present there already), and\n> > perhaps open 'summary' page for said repository.\n> \n> Yeah, we can do that but I think I will do it in another commit.\n\n...this is really needed, in my opinion.\n\nI agree that it should be in separate commit.\n\n-- \nJakub Narebski\nPoland\n"}]}