git instaweb for Debian squeeze (Re: Bug#592733: git instaweb broken)

Subsystems: the rest

9 messages, 2 authors, 2016-06-15 · open the first message on its own page

git instaweb for Debian squeeze (Re: Bug#592733: git instaweb broken)

From: Jonathan Nieder <hidden>
Date: 2016-06-15 22:49:28

Hi again,

Uwe Kleine-König wrote:
when I start git instaweb on a git repository, I get a crippled view
(no style sheets, no images) that doesn't include the current project.
Ok, so the proper fix is v1.7.2-rc0~55^2~3, but that seems too dramatic
to try at the moment for squeeze (for which the plan is to basically
go with gitweb and instaweb 1.7.1).  Does this workaround help?

Eric, do you think it is worth duplicating the logo and favicon within
pre-v1.7.2 instaweb?  The script already takes 252 KiB, so an extra
10 KiB might not be such a big deal.

Signed-off-by: Jonathan Nieder <redacted>
---
diff --git a/git-instaweb.sh b/git-instaweb.sh
index 0c6e103..95d3d0a 100755
--- a/git-instaweb.sh
+++ b/git-instaweb.sh
@@ -387,7 +387,11 @@ script='
 s#^(my|our) \$projectroot =.*#$1 \$projectroot = "'$(dirname "$fqgitdir")'";#;
 s#(my|our) \$gitbin =.*#$1 \$gitbin = "'$GIT_EXEC_PATH'";#;
 s#(my|our) \$projects_list =.*#$1 \$projects_list = \$projectroot;#;
-s#(my|our) \$git_temp =.*#$1 \$git_temp = "'$fqgitdir/gitweb/tmp'";#;'
+s#(my|our) \$git_temp =.*#$1 \$git_temp = "'$fqgitdir/gitweb/tmp'";#;
+s#(my|our) \$logo =.*#$1 \$logo = "/usr/share/gitweb/git-logo.png";#;
+s#(my|our) \$favicon =.*#$1 \$favicon = "/usr/share/gitweb/git-favicon.png";#;
+s#(my|our) \$GITWEB_CONFIG_SYSTEM =.*#$1 \$GITWEB_CONFIG_SYSTEM = "";#;'
+
 
 gitweb_cgi () {
 	cat > "$1.tmp" <<\EOFGITWEB
-- 

Re: git instaweb for Debian squeeze (Re: Bug#592733: git instaweb broken)

From: Eric Wong <hidden>
Date: 2016-06-15 22:49:28

Jonathan Nieder [off-list ref] wrote:
Uwe Kleine-König wrote:
quoted
when I start git instaweb on a git repository, I get a crippled view
(no style sheets, no images) that doesn't include the current project.
Eric, do you think it is worth duplicating the logo and favicon within
pre-v1.7.2 instaweb?  The script already takes 252 KiB, so an extra
10 KiB might not be such a big deal.
The stylesheet is important and should be fixed.  I don't care about the
logo and favicon (warning: I've never been a fan of logos/icons,
needless noise IMHO), but if you're willing to help maintain it then
it's fine by me.

-- 
Eric Wong

[PATCH/RFC maint-1.7.1 0/4] instaweb 1.7.1 fixes for Debian squeeze

From: Jonathan Nieder <hidden>
Date: 2016-06-15 22:49:28

Eric Wong wrote:
quoted
Uwe Kleine-König wrote:
quoted
when I start git instaweb on a git repository, I get a crippled view
(no style sheets, no images) that doesn't include the current project.
[...]
The stylesheet is important and should be fixed.  I don't care about the
logo and favicon (warning: I've never been a fan of logos/icons,
needless noise IMHO), but if you're willing to help maintain it then
it's fine by me.
Thanks, Eric; that makes sense.  How about this?

The purpose of this series is the first patch, which allows
old-fashioned instaweb to run even if /etc/gitweb.conf specifies some
layout it does not expect.

I suspect this problem is already fixed in maint by v1.7.2-rc0~55^2~3
(git-instaweb: Configure it to work with new gitweb structure,
2010-05-28; thanks, Pavan!), but users that do not like gitweb version
numbers with a 2 in them will not be able to use that.

Patches 2-4 fix some spurious 404 errors due to missing images,
noticed while debugging.

Patches are against Junio's maint-1.7.1.

Jonathan Nieder (4):
  instaweb: ignore GITWEB_CONFIG_SYSTEM
  gitweb: skip logo in atom feed when there is none
  gitweb: make logo optional
  instaweb: disable logo and favicon by default

 git-instaweb.sh    |    6 +++++-
 gitweb/gitweb.perl |   12 +++++++-----
 2 files changed, 12 insertions(+), 6 deletions(-)

-- 
1.7.2.2

[PATCH 1/4] instaweb: ignore GITWEB_CONFIG_SYSTEM

From: Jonathan Nieder <hidden>
Date: 2016-06-15 22:49:28

The configuration in /etc/gitweb.conf might specify any old
layout; in particular, it is likely not to be identical to that
which git instaweb sets up.  Noticed by Uwe Kleine-König.

Reported-by: Uwe Kleine-König <redacted>
Cc: Eric Wong <redacted>
Signed-off-by: Jonathan Nieder <redacted>
---
 git-instaweb.sh |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/git-instaweb.sh b/git-instaweb.sh
index f608014..6279f4d 100755
--- a/git-instaweb.sh
+++ b/git-instaweb.sh
@@ -375,7 +375,8 @@ script='
 s#^(my|our) \$projectroot =.*#$1 \$projectroot = "'$(dirname "$fqgitdir")'";#;
 s#(my|our) \$gitbin =.*#$1 \$gitbin = "'$GIT_EXEC_PATH'";#;
 s#(my|our) \$projects_list =.*#$1 \$projects_list = \$projectroot;#;
-s#(my|our) \$git_temp =.*#$1 \$git_temp = "'$fqgitdir/gitweb/tmp'";#;'
+s#(my|our) \$git_temp =.*#$1 \$git_temp = "'$fqgitdir/gitweb/tmp'";#;
+s#(my|our) \$GITWEB_CONFIG_SYSTEM =.*#$1 \$GITWEB_CONFIG_SYSTEM = "";#;'
 
 gitweb_cgi () {
 	cat > "$1.tmp" <<\EOFGITWEB
-- 
1.7.2.2

[PATCH 2/4] gitweb: skip logo in atom feed when there is none

From: Jonathan Nieder <hidden>
Date: 2016-06-15 22:49:28

With v1.5.0-rc0~169 (gitweb: Fix Atom feed <logo>: it is $logo,
not $logo_url, 2006-12-04), the logo URI to be written to Atom
feeds was corrected but the case of no logo forgotten.

Cc: Jakub Narebski <redacted>
Cc: Eric Wong <redacted>
Signed-off-by: Jonathan Nieder <redacted>
---
Theoretical, untested.

 gitweb/gitweb.perl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index a97ce03..cc20e74 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -6630,7 +6630,7 @@ XML
 		if (defined $favicon) {
 			print "<icon>" . esc_url($favicon) . "</icon>\n";
 		}
-		if (defined $logo_url) {
+		if (defined $logo) {
 			# not twice as wide as tall: 72 x 27 pixels
 			print "<logo>" . esc_url($logo) . "</logo>\n";
 		}
-- 
1.7.2.2

[PATCH 3/4] gitweb: make logo optional

From: Jonathan Nieder <hidden>
Date: 2016-06-15 22:49:28

Some sites may not want to have a logo at all.  In particular,
git instaweb can benefit from this.

Cc: Jakub Narebski <redacted>
Cc: Eric Wong <redacted>
Signed-off-by: Jonathan Nieder <redacted>
---
 gitweb/gitweb.perl |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index cc20e74..9a72562 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -3269,10 +3269,12 @@ EOF
 		insert_file($site_header);
 	}
 
-	print "<div class=\"page_header\">\n" .
-	      $cgi->a({-href => esc_url($logo_url),
-	               -title => $logo_label},
-	              qq(<img src="$logo" width="72" height="27" alt="git" class="logo"/>));
+	print "<div class=\"page_header\">\n";
+	if (defined $logo) {
+		print $cgi->a({-href => esc_url($logo_url),
+		               -title => $logo_label},
+		              qq(<img src="$logo" width="72" height="27" alt="git" class="logo"/>));
+	}
 	print $cgi->a({-href => esc_url($home_link)}, $home_link_str) . " / ";
 	if (defined $project) {
 		print $cgi->a({-href => href(action=>"summary")}, esc_html($project));
-- 
1.7.2.2

[PATCH 4/4] instaweb: disable logo and favicon by default

From: Jonathan Nieder <hidden>
Date: 2016-06-15 22:49:28

Avoid 404 errors due to the missing git logo and favicon.

Reported-by: Uwe Kleine-König <redacted>
Cc: Eric Wong <redacted>
Cc: Jakub Narebski <redacted>
Signed-off-by: Jonathan Nieder <redacted>
---
Thanks for reading.

 git-instaweb.sh |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/git-instaweb.sh b/git-instaweb.sh
index 6279f4d..1128b31 100755
--- a/git-instaweb.sh
+++ b/git-instaweb.sh
@@ -376,7 +376,9 @@ s#^(my|our) \$projectroot =.*#$1 \$projectroot = "'$(dirname "$fqgitdir")'";#;
 s#(my|our) \$gitbin =.*#$1 \$gitbin = "'$GIT_EXEC_PATH'";#;
 s#(my|our) \$projects_list =.*#$1 \$projects_list = \$projectroot;#;
 s#(my|our) \$git_temp =.*#$1 \$git_temp = "'$fqgitdir/gitweb/tmp'";#;
-s#(my|our) \$GITWEB_CONFIG_SYSTEM =.*#$1 \$GITWEB_CONFIG_SYSTEM = "";#;'
+s#(my|our) \$GITWEB_CONFIG_SYSTEM =.*#$1 \$GITWEB_CONFIG_SYSTEM = "";#;
+s#(my|our) \$favicon =.*#$1 \$favicon = undef;#;'
+s#(my|our) \$logo =.*#$1 \$logo = undef;#;'
 
 gitweb_cgi () {
 	cat > "$1.tmp" <<\EOFGITWEB
-- 
1.7.2.2

Re: [PATCH/RFC maint-1.7.1 0/4] instaweb 1.7.1 fixes for Debian squeeze

From: Eric Wong <hidden>
Date: 2016-06-15 22:49:28

Jonathan Nieder [off-list ref] wrote:
Eric Wong wrote:
quoted
quoted
Uwe Kleine-König wrote:
quoted
when I start git instaweb on a git repository, I get a crippled view
(no style sheets, no images) that doesn't include the current project.
[...]
quoted
The stylesheet is important and should be fixed.  I don't care about the
logo and favicon (warning: I've never been a fan of logos/icons,
needless noise IMHO), but if you're willing to help maintain it then
it's fine by me.
Thanks, Eric; that makes sense.  How about this?
Untested, but everything looks reasonable to me, thanks!

-- 
Eric Wong

[PATCH v2 4/4] instaweb: disable logo and favicon by default

From: Jonathan Nieder <hidden>
Date: 2016-06-15 22:49:28

Avoid 404 errors due to the missing git logo and favicon.

Reported-by: Uwe Kleine-König <redacted>
Cc: Eric Wong <redacted>
Cc: Jakub Narebski <redacted>
Signed-off-by: Jonathan Nieder <redacted>
---
Jonathan Nieder wrote:
quoted hunk
--- a/git-instaweb.sh
+++ b/git-instaweb.sh
@@ -376,7 +376,9 @@ s#^(my|our) \$projectroot =.*#$1 \$projectroot = "'$(dirname "$fqgitdir")'";#;
 s#(my|our) \$gitbin =.*#$1 \$gitbin = "'$GIT_EXEC_PATH'";#;
 s#(my|our) \$projects_list =.*#$1 \$projects_list = \$projectroot;#;
 s#(my|our) \$git_temp =.*#$1 \$git_temp = "'$fqgitdir/gitweb/tmp'";#;
-s#(my|our) \$GITWEB_CONFIG_SYSTEM =.*#$1 \$GITWEB_CONFIG_SYSTEM = "";#;'
+s#(my|our) \$GITWEB_CONFIG_SYSTEM =.*#$1 \$GITWEB_CONFIG_SYSTEM = "";#;
+s#(my|our) \$favicon =.*#$1 \$favicon = undef;#;'
+s#(my|our) \$logo =.*#$1 \$logo = undef;#;'
Stray apostrophe; sorry about that.  Here's a replacement.

 git-instaweb.sh |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/git-instaweb.sh b/git-instaweb.sh
index 6279f4d..0725596 100755
--- a/git-instaweb.sh
+++ b/git-instaweb.sh
@@ -376,7 +376,9 @@ s#^(my|our) \$projectroot =.*#$1 \$projectroot = "'$(dirname "$fqgitdir")'";#;
 s#(my|our) \$gitbin =.*#$1 \$gitbin = "'$GIT_EXEC_PATH'";#;
 s#(my|our) \$projects_list =.*#$1 \$projects_list = \$projectroot;#;
 s#(my|our) \$git_temp =.*#$1 \$git_temp = "'$fqgitdir/gitweb/tmp'";#;
-s#(my|our) \$GITWEB_CONFIG_SYSTEM =.*#$1 \$GITWEB_CONFIG_SYSTEM = "";#;'
+s#(my|our) \$GITWEB_CONFIG_SYSTEM =.*#$1 \$GITWEB_CONFIG_SYSTEM = "";#;
+s#(my|our) \$favicon =.*#$1 \$favicon = undef;#;
+s#(my|our) \$logo =.*#$1 \$logo = undef;#;'
 
 gitweb_cgi () {
 	cat > "$1.tmp" <<\EOFGITWEB
-- 
1.7.2.2
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help