Skip to contentSkip to conversation

git-instaweb: Configure it to work with new gitweb structure

PATCH In review Pavan Kumar Sunkara 4 participants 7 messages Jun 15, 2016 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 git-instaweb: Configure it to work with new gitweb structure

git-instaweb in its current form (re)creates gitweb.cgi and (some of) required static files in $GIT_DIR/gitweb/ directory. Splitting gitweb would make it difficult for git-instaweb to continue with this method.

Use the instaweb.gitwebdir config variable to point git-instaweb script to a global directory which contains gitweb files as server root and the httpd.conf along with server logs and pid go into '$(GIT_DIR)/gitweb' directory.

While at it, change apache2 configuration to use the same access log and error log files as the rest of web servers supported by git-instaweb.

---

This patch is based on 'jn/gitweb-install' in the next branch by Jakub Nareski and my previous 2 patches:
* gitweb: Move static files into seperate subdirectory
http://article.gmane.org/gmane.comp.version-control.git/147321
* gitweb: Set default destination directory for installing gitweb in Makefile
http://article.gmane.org/gmane.comp.version-control.git/147160

 Makefile        |   11 ++------
 git-instaweb.sh |   71 ++++++++++++++++++++----------------------------------
 2 files changed, 29 insertions(+), 53 deletions(-)
Makefile +3 -8
index caf2f64..9161172 100644
@@ -1426,6 +1426,7 @@ gitexecdir_SQ = $(subst ','\'',$(gitexecdir))
 template_dir_SQ = $(subst ','\'',$(template_dir))
 htmldir_SQ = $(subst ','\'',$(htmldir))
 prefix_SQ = $(subst ','\'',$(prefix))
+gitwebdir_SQ = $(subst ','\'',$(gitwebdir))
 
 SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
 PERL_PATH_SQ = $(subst ','\'',$(PERL_PATH))
@@ -1592,15 +1593,8 @@ git-instaweb: git-instaweb.sh gitweb/gitweb.cgi gitweb/static/gitweb.css gitweb/
 	sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
 	    -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
 	    -e 's/@@NO_CURL@@/$(NO_CURL)/g' \
-	    -e '/@@GITWEB_CGI@@/r gitweb/gitweb.cgi' \
-	    -e '/@@GITWEB_CGI@@/d' \
-	    -e '/@@GITWEB_CSS@@/r $(GITWEB_CSS)' \
-	    -e '/@@GITWEB_CSS@@/d' \
-	    -e '/@@GITWEB_JS@@/r $(GITWEB_JS)' \
-	    -e '/@@GITWEB_JS@@/d' \
+	    -e 's|@@GITWEBDIR@@|$(gitwebdir_SQ)|g' \
 	    -e 's|@@PERL@@|$(PERL_PATH_SQ)|g' \
-            -e 's|@@GITWEB_CSS_NAME@@|$(GITWEB_CSS)|' \
-            -e 's|@@GITWEB_JS_NAME@@|$(GITWEB_JS)|' \
 	    [email protected] > $@+ && \
 	chmod +x $@+ && \
 	mv $@+ $@
@@ -1972,6 +1966,7 @@ install: all
 	$(MAKE) -C templates DESTDIR='$(DESTDIR_SQ)' install
 ifndef NO_PERL
 	$(MAKE) -C perl prefix='$(prefix_SQ)' DESTDIR='$(DESTDIR_SQ)' install
+	$(MAKE) -C gitweb gitwebdir=$(gitwebdir_SQ) install
 endif
 ifndef NO_PYTHON
 	$(MAKE) -C git_remote_helpers prefix='$(prefix_SQ)' DESTDIR='$(DESTDIR_SQ)' install
git-instaweb.sh +26 -45

156 lines not on this page · raw message

Signature · 1 line
1.7.1.18.g74211d.dirty
#1 lore raw
Quoted 3 lines · Pavan Kumar Sunkara

While at it, change apache2 configuration to use the same access log and error log files as the rest of web servers supported by git-instaweb.

Hi Pavan, I'm late to this thread, but I'm leaning against forcing access logs onto people. I don't believe access logs are necessary for instaweb. Error logs are important for debugging breakage, yes, but access logs aren't worth the trouble IMHO.

Also, using the same error log paths might make it confusing to people switching between web servers. In fact, it may be the most confusing for those folks if they're trying different web servers and forgetting to shut down the previous server before starting the next. They could end up seeing confusing log messages from the wrong server if they look in the error log to debug the problem.

I'm not sure why Mongoose has access logs enabled by default, but I know I conciously left it out by default for lighttpd/apache/webrick.

Signature · 1 line
Eric Wong
#2 lore raw
Quoted 17 lines · Eric Wong
Quoted 3 lines · Pavan Kumar Sunkara

While at it, change apache2 configuration to use the same access log and error log files as the rest of web servers supported by git-instaweb.

Hi Pavan, I'm late to this thread, but I'm leaning against forcing access logs onto people.  I don't believe access logs are necessary for instaweb.  Error logs are important for debugging breakage, yes, but access logs aren't worth the trouble IMHO.

Also, using the same error log paths might make it confusing to people switching between web servers.  In fact, it may be the most confusing for those folks if they're trying different web servers and forgetting to shut down the previous server before starting the next.  They could end up seeing confusing log messages from the wrong server if they look in the error log to debug the problem.

Quoted 5 lines

I'm not sure why Mongoose has access logs enabled by default, but I know I conciously left it out by default for lighttpd/apache/webrick.

--
Eric Wong

Well, Until before this patch, lighttpd and mongoose have been using the same error log and access log.
So, I enabled it for apache2 too in the process of debugging git-instaweb while using apache2.

IMVHO If there is no problem using the same logs for lighttpd and mongoose until now, I don't think it will be a problem when apache2 is included into that group.

- Pavan

Quoted 1 line
Acked-by on v3 1/1
#3 lore raw
In reply to Pavan Kumar Sunkara
Quoted 10 lines · Pavan Kumar Sunkara

git-instaweb in its current form (re)creates gitweb.cgi and (some of) required static files in $GIT_DIR/gitweb/ directory. Splitting gitweb would make it difficult for git-instaweb to continue with this method.

Use the instaweb.gitwebdir config variable to point git-instaweb script to a global directory which contains gitweb files as server root and the httpd.conf along with server logs and pid go into '$(GIT_DIR)/gitweb' directory.

Quoted 5 lines

While at it, change apache2 configuration to use the same access log and error log files as the rest of web servers supported by git-instaweb.

For what it is worth:

But I think more important would be ACK from Eric Wong, author and maintainer of git-instaweb. I guess that because it is preparatory work, only related to the main stated goal of your GSoC 2010, you don't need "signoff" from mentor(s) (in the form of Mentored-by:)...

Signature · 2 lines
Jakub Narebski
Poland
#4 lore raw
In reply to Pavan Kumar Sunkara

Hi Pavan,

Quoted 7 lines · On Sunday 23 May 2010 09:32:48 Pavan Kumar Sunkara wrote:

This patch is based on 'jn/gitweb-install' in the next branch by Jakub
Nareski and my previous 2 patches:
* gitweb: Move static files into seperate subdirectory
http://article.gmane.org/gmane.comp.version-control.git/147321
* gitweb: Set default destination directory for installing gitweb in Makefile http://article.gmane.org/gmane.comp.version-control.git/147160

I tried to apply your 2 patches on top of next I got some errors with the "Move static files into seperate subdirectory" patch.

Could you resend the 3 patches in a patch series after making sure that they apply on top of next?

And I think that it would be better if the web server logs would be in a directory with the web server name. For example "$fqgitdir/gitweb/$httpd/access.log" instead of "$fqgitdir/gitweb/access.log". But it would be nice if you make these changes (as well as the apache2 confguration changes) in another patch.

Thanks in advance,
Christian.

#5 lore raw
Quoted 5 lines · Christian Couder

And I think that it would be better if the web server logs would be in a directory with the web server name. For example "$fqgitdir/gitweb/$httpd/access.log" instead of "$fqgitdir/gitweb/access.log". But it would be nice if you make these changes (as well as the apache2 configuration changes) in another patch.

You probably meant "$fqgitdir/gitweb/$httpd_only/access.log", and not "$fqgitdir/gitweb/$httpd/access.log" ($httpd_only in place of $httpd), because $httpd might be 'apache2 -f' in the case of 'apache2', or in the future "$fqgitdir/gitweb/gitweb.psgi" in the case of 'plackup'.

Just FYI

Signature · 2 lines
Jakub Narebski
Poland
#6 lore raw
In reply to Christian Couder
Quoted 11 lines · Christian Couder

Hi Pavan,

Quoted 7 lines · On Sunday 23 May 2010 09:32:48 Pavan Kumar Sunkara wrote:

This patch is based on 'jn/gitweb-install' in the next branch by Jakub Nareski and my previous 2 patches:
* gitweb: Move static files into seperate subdirectory
 http://article.gmane.org/gmane.comp.version-control.git/147321
* gitweb: Set default destination directory for installing gitweb in Makefile http://article.gmane.org/gmane.comp.version-control.git/147160

Quoted 2 lines

I tried to apply your 2 patches on top of next I got some errors with the "Move static files into seperate subdirectory" patch.

It is a small error in Makefile only with this patch. The others are ok. I teseted it with alt-git.git repository's next branch.
So, I will be sending only that patch once again.

Quoted 9 lines

Could you resend the 3 patches in a patch series after making sure that they apply on top of next?

And I think that it would be better if the web server logs would be in a directory with the web server name. For example "$fqgitdir/gitweb/$httpd/access.log" instead of "$fqgitdir/gitweb/access.log". But it would be nice if you make these changes (as well as the apache2 confguration changes) in another patch.

Yeah. Sure.

- Pavan