# [PATCH 0/2] gitweb: make logo optional

8 messages from 2011-01-04 to 2011-01-05. Participants: Jonathan Nieder, Jakub Narebski, Eric Wong, Junio C Hamano.
Thread: https://gitlist.dev/t/26183

## Jonathan Nieder, 2011-01-04 05:02

Subject: [PATCH 0/2] gitweb: make logo optional
Message-ID: <20110104050206.GA8280@burratino>
URL: https://gitlist.dev/e/20110104050206.GA8280%40burratino

```
These patches were last seen in the instaweb 1.7.1 maintenance
thread[1] but I believe they are independently useful.  The
idea is to allow disabling the logo in gitweb.

Jonathan Nieder (2):
  gitweb: skip logo in atom feed when there is none
  gitweb: make logo optional

 gitweb/gitweb.perl |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

[1] http://thread.gmane.org/gmane.comp.version-control.git/155224

```

## Jonathan Nieder, 2011-01-04 05:02

Subject: [PATCH 1/2] gitweb: skip logo in atom feed when there is none
Message-ID: <20110104050247.GB8280@burratino>
URL: https://gitlist.dev/e/20110104050247.GB8280%40burratino
In-Reply-To: <20110104050206.GA8280@burratino>

```
Date: Fri, 3 Sep 2010 19:44:39 -0500

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.

Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
 gitweb/gitweb.perl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 4779618..c65af1a 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -7169,7 +7169,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.4.rc0

```

## Jonathan Nieder, 2011-01-04 05:05

Subject: [PATCH 2/2] gitweb: make logo optional
Message-ID: <20110104050555.GC8280@burratino>
URL: https://gitlist.dev/e/20110104050555.GC8280%40burratino
In-Reply-To: <20110104050206.GA8280@burratino>

```
Date: Fri, 3 Sep 2010 19:45:09 -0500

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

While at it, use $cgi->img to simplify this code.  (CGI.pm learned
most HTML4 tags by version 2.79, so this should be portable to perl
5.8, though I haven't tested.)

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
Eric liked an earlier version of this patch that did not use
$cgi->img.

 gitweb/gitweb.perl |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index c65af1a..064697c 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -3601,10 +3601,15 @@ EOF
 		insert_file($site_header);
 	}
 
-	print "<div class=\"page_header\">\n" .
-	      $cgi->a({-href => esc_url($logo_url),
-	               -title => $logo_label},
-	              qq(<img src=").esc_url($logo).qq(" 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},
+		              $cgi->img({-src => esc_url($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.4.rc0

```

## Jakub Narebski, 2011-01-04 11:52

Subject: Re: [PATCH 2/2] gitweb: make logo optional
Message-ID: <201101041252.40254.jnareb@gmail.com>
URL: https://gitlist.dev/e/201101041252.40254.jnareb%40gmail.com
In-Reply-To: <20110104050555.GC8280@burratino>

```
On Tue, 4 Dec 2011, Jonathan Nieder wrote:

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

Why do you think that git-instaweb can benefit from not having logo?
You need gitweb.css anyway, so it is not much more trouble to serve
additional static file, git-logo.png.

> 
> While at it, use $cgi->img to simplify this code.  (CGI.pm learned
> most HTML4 tags by version 2.79, so this should be portable to perl
> 5.8, though I haven't tested.)

corelist (Module::CoreList) says that Perl 5.8.0 has CGI.pm version 2.81;
IIRC gitweb requires something later than 5.8.0 for good support of
Unicode (Encode module).

> 
> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>

For what it is worth it:

Acked-by: Jakub Narebski <jnareb@gmail.com>

-- 
Jakub Narebski
Poland

```

## Jonathan Nieder, 2011-01-04 16:29

Subject: Re: [PATCH 2/2] gitweb: make logo optional
Message-ID: <20110104162918.GA30141@burratino>
URL: https://gitlist.dev/e/20110104162918.GA30141%40burratino
In-Reply-To: <201101041252.40254.jnareb@gmail.com>

```
Jakub Narebski wrote:
> On Tue, 4 Dec 2011, Jonathan Nieder wrote:

>> Some sites may not want to have a logo at all.  In particular, git
>> instaweb can benefit from this.
>
> Why do you think that git-instaweb can benefit from not having logo?
> You need gitweb.css anyway, so it is not much more trouble to serve
> additional static file, git-logo.png.

Yep, that sentence is stale (it only applied in 1.7.1.x days) and
should have been removed.

> corelist (Module::CoreList) says that Perl 5.8.0 has CGI.pm version 2.81;
> IIRC gitweb requires something later than 5.8.0 for good support of
> Unicode (Encode module).
>
>>
>> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
>
> For what it is worth it:
>
> Acked-by: Jakub Narebski <jnareb@gmail.com>

Thanks for looking it over.

```

## Eric Wong, 2011-01-04 23:24

Subject: Re: [PATCH 0/2] gitweb: make logo optional
Message-ID: <20110104232430.GB15889@dcvr.yhbt.net>
URL: https://gitlist.dev/e/20110104232430.GB15889%40dcvr.yhbt.net
In-Reply-To: <20110104050206.GA8280@burratino>

```
Jonathan Nieder <jrnieder@gmail.com> wrote:
> These patches were last seen in the instaweb 1.7.1 maintenance
> thread[1] but I believe they are independently useful.  The
> idea is to allow disabling the logo in gitweb.
> 
> Jonathan Nieder (2):
>   gitweb: skip logo in atom feed when there is none
>   gitweb: make logo optional

This series looks good to me (especially considering my strong
dislike of logos/icons on the web :>)

Acked-by: Eric Wong <normalperson@yhbt.net>

-- 
Eric Wong

```

## Jakub Narebski, 2011-01-05 00:25

Subject: Re: [PATCH 1/2] gitweb: skip logo in atom feed when there is none
Message-ID: <201101050125.52824.jnareb@gmail.com>
URL: https://gitlist.dev/e/201101050125.52824.jnareb%40gmail.com
In-Reply-To: <20110104050247.GB8280@burratino>

```
Jonathan Nieder wrote:
> Date: Fri, 3 Sep 2010 19:44:39 -0500
> 
> 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.
> 
> Acked-by: Eric Wong <normalperson@yhbt.net>
> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>

Good catch.  As an obvious bugfix:

Acked-by: Jakub Narebski <jnareb@gmail.com>

> ---
>  gitweb/gitweb.perl |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
> index 4779618..c65af1a 100755
> --- a/gitweb/gitweb.perl
> +++ b/gitweb/gitweb.perl
> @@ -7169,7 +7169,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.4.rc0
> 
> 

-- 
Jakub Narebski
Poland

```

## Junio C Hamano, 2011-01-05 00:45

Subject: Re: [PATCH 1/2] gitweb: skip logo in atom feed when there is none
Message-ID: <7v62u4dvpf.fsf@alter.siamese.dyndns.org>
URL: https://gitlist.dev/e/7v62u4dvpf.fsf%40alter.siamese.dyndns.org
In-Reply-To: <201101050125.52824.jnareb@gmail.com>

```
Thanks, all.

```
