Skip to contentSkip to conversation

gitweb: ensure the default stylesheet is accessible

PATCH In review Giuseppe Bilotta 2 participants 3 messages Jun 15, 2016 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gitweb: ensure the default stylesheet is accessible

On some installations the CSS fails to be linked correctly when path_info is enabled, since the link refers to "gitweb.css", whereas it should be "${my_uri}/gitweb.css". Fix by setting the appropriate default in the Makefile.

---
 Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Makefile +1 -1
index 4ef8234..4f60de9 100644
@@ -215,7 +215,7 @@ GITWEB_STRICT_EXPORT =
 GITWEB_BASE_URL =
 GITWEB_LIST =
 GITWEB_HOMETEXT = indextext.html
-GITWEB_CSS = gitweb.css
+GITWEB_CSS = $${my_uri}/gitweb.css
 GITWEB_LOGO = git-logo.png
 GITWEB_FAVICON = git-favicon.png
 GITWEB_SITE_HEADER =
Signature · 1 line
1.5.6.5
#1 lore raw
Quoted 4 lines · Giuseppe Bilotta

On some installations the CSS fails to be linked correctly when path_info is enabled, since the link refers to "gitweb.css", whereas it should be "${my_uri}/gitweb.css". Fix by setting the appropriate default in the Makefile.

Why "on some installations"? What does "some" mean? I don't think it is something indeterministic: please spell when one can have problems with linking CSS file.

Wouldn't it be simpler to deal with problem of base URL when using path_info gitweb URLs to add BASE element to HTML head if we use path_info? Something like:

	if ($ENV{'PATH_INFO'}) {  # $path_info is unfortunately stripped
		print qq(<base href="$my_uri">\n);
	} 

somewhere in git_header_html() subroutine?

See also comment below.

Quoted 11 lines
---
 Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Makefile +0 -0
index 4ef8234..4f60de9 100644

Makefile GITWEB_STRICT_EXPORT = · line 220

Quoted 7 lines
Makefile +1 -1
@@ -215,7 +215,7 @@ GITWEB_STRICT_EXPORT =
 GITWEB_BASE_URL =
 GITWEB_LIST =
 GITWEB_HOMETEXT = indextext.html
-GITWEB_CSS = gitweb.css
+GITWEB_CSS = $${my_uri}/gitweb.css
 GITWEB_LOGO = git-logo.png
 GITWEB_FAVICON = git-favicon.png

It is not the same case for git-logo.png and git-favicon.png as for gitweb.css? If it is not, please explain why in commit message. If it is, then your patch is only partial solution to path_info problem.

Quoted 5 lines
Makefile +0 -0
 GITWEB_SITE_HEADER =
Signature · 1 line
1.5.6.5
Signature · 2 lines
Jakub Narebski
Poland
#2 lore raw
Quoted 10 lines · Jakub Narebski
Quoted 4 lines · Giuseppe Bilotta

On some installations the CSS fails to be linked correctly when path_info is enabled, since the link refers to "gitweb.css", whereas it should be "${my_uri}/gitweb.css". Fix by setting the appropriate default in the Makefile.

Why "on some installations"? What does "some" mean? I don't think it is something indeterministic: please spell when one can have problems with linking CSS file.

The truth is, I haven't the slightest idea. It works fine on my machine, it doesn't without the patch on ruby-rbot.org, but I really don't know why.

Quoted 9 lines

Wouldn't it be simpler to deal with problem of base URL when using path_info gitweb URLs to add BASE element to HTML head if we use path_info? Something like:

       if ($ENV{'PATH_INFO'}) {  # $path_info is unfortunately stripped
               print qq(<base href="$my_uri">\n);
       }

somewhere in git_header_html() subroutine?

Ah, this might work. I'll test it.

Quoted 4 lines

It is not the same case for git-logo.png and git-favicon.png as for gitweb.css? If it is not, please explain why in commit message. If it is, then your patch is only partial solution to path_info problem.

Oh, interesting, true, I hadn't noticed.

I'll look into the base thing.

Signature · 1 line
Giuseppe "Oblomov" Bilotta