@matheusbsbs / matheus-bagliano / commits / 281f2f6b45
Fork 0

gitweb: use out-of-line GIT logo.

Use the normal web server instead of the CGI to provide the git logo, just like the gitweb.css. Signed-off-by: Martin Waitz <tali@admingilde.org> Signed-off-by: Junio C Hamano <junkio@cox.net>

Martin Waitz committed Jul 31, 2006 at 00:38 UTC 281f2f6b45bf62e5bc81a6b457f1f7d26c426ea3
4 files changed +8 -25
Makefile
+2
@@ -122,6 +122,7 @@ GITWEB_PROJECTROOT = /pub/git
122 GITWEB_LIST =
123 GITWEB_HOMETEXT = indextext.html
124 GITWEB_CSS = gitweb.css
125 +GITWEB_LOGO = git-logo.png
126
127 export prefix bindir gitexecdir template_dir GIT_PYTHON_DIR
128
@@ -589,6 +590,7 @@ gitweb/gitweb.cgi: gitweb/gitweb.perl
590 -e 's|@@GITWEB_LIST@@|$(GITWEB_LIST)|g' \
591 -e 's|@@GITWEB_HOMETEXT@@|$(GITWEB_HOMETEXT)|g' \
592 -e 's|@@GITWEB_CSS@@|$(GITWEB_CSS)|g' \
593 + -e 's|@@GITWEB_LOGO@@|$(GITWEB_LOGO)|g' \
594 $< >$@+
595 chmod +x $@+
596 mv $@+ $@
gitweb/README
+2
@@ -21,6 +21,8 @@ You can specify the following configuration variables when building GIT:
21 overview page.
22 * GITWEB_CSS
23 Points to the location where you put gitweb.css on your web server.
24 + * GITWEB_LOGO
25 + Points to the location where you put git-logo.png on your web server.
26
27 Any comment/question/concern to:
28 Kay Sievers <kay.sievers@vrfy.org>
gitweb/git-logo.png
Binary files /dev/null and b/gitweb/git-logo.png differ
gitweb/gitweb.perl
+4 -25
@@ -52,6 +52,8 @@ our $home_text = "@@GITWEB_HOMETEXT@@";
52
53 # URI of default stylesheet
54 our $stylesheet = "@@GITWEB_CSS@@";
55 +# URI of GIT logo
56 +our $logo = "@@GITWEB_LOGO@@";
57
58 # source of projects list
59 our $projects_list = "@@GITWEB_LIST@@" || "$projectroot";
@@ -71,10 +73,7 @@ if (defined $action) {
73 undef $action;
74 die_error(undef, "Invalid action parameter.");
75 }
74 - if ($action eq "git-logo.png") {
75 - git_logo();
76 - exit;
77 - } elsif ($action eq "opml") {
76 + if ($action eq "opml") {
77 git_opml();
78 exit;
79 }
@@ -873,7 +872,7 @@ $rss_link
872 EOF
873 print "<div class=\"page_header\">\n" .
874 "<a href=\"http://www.kernel.org/pub/software/scm/git/docs/\" title=\"git documentation\">" .
876 - "<img src=\"$my_uri?" . esc_param("a=git-logo.png") . "\" width=\"72\" height=\"27\" alt=\"git\" style=\"float:right; border-width:0px;\"/>" .
875 + "<img src=\"$logo\" width=\"72\" height=\"27\" alt=\"git\" style=\"float:right; border-width:0px;\"/>" .
876 "</a>\n";
877 print $cgi->a({-href => esc_param($home_link)}, "projects") . " / ";
878 if (defined $project) {
@@ -1267,26 +1266,6 @@ sub git_diff_print {
1266 ## ======================================================================
1267 ## actions
1268
1270 -# git-logo (cached in browser for one day)
1271 -sub git_logo {
1272 - binmode STDOUT, ':raw';
1273 - print $cgi->header(-type => 'image/png', -expires => '+1d');
1274 - # cat git-logo.png | hexdump -e '16/1 " %02x" "\n"' | sed 's/ /\\x/g'
1275 - print "\x89\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52" .
1276 - "\x00\x00\x00\x48\x00\x00\x00\x1b\x04\x03\x00\x00\x00\x2d\xd9\xd4" .
1277 - "\x2d\x00\x00\x00\x18\x50\x4c\x54\x45\xff\xff\xff\x60\x60\x5d\xb0" .
1278 - "\xaf\xaa\x00\x80\x00\xce\xcd\xc7\xc0\x00\x00\xe8\xe8\xe6\xf7\xf7" .
1279 - "\xf6\x95\x0c\xa7\x47\x00\x00\x00\x73\x49\x44\x41\x54\x28\xcf\x63" .
1280 - "\x48\x67\x20\x04\x4a\x5c\x18\x0a\x08\x2a\x62\x53\x61\x20\x02\x08" .
1281 - "\x0d\x69\x45\xac\xa1\xa1\x01\x30\x0c\x93\x60\x36\x26\x52\x91\xb1" .
1282 - "\x01\x11\xd6\xe1\x55\x64\x6c\x6c\xcc\x6c\x6c\x0c\xa2\x0c\x70\x2a" .
1283 - "\x62\x06\x2a\xc1\x62\x1d\xb3\x01\x02\x53\xa4\x08\xe8\x00\x03\x18" .
1284 - "\x26\x56\x11\xd4\xe1\x20\x97\x1b\xe0\xb4\x0e\x35\x24\x71\x29\x82" .
1285 - "\x99\x30\xb8\x93\x0a\x11\xb9\x45\x88\xc1\x8d\xa0\xa2\x44\x21\x06" .
1286 - "\x27\x41\x82\x40\x85\xc1\x45\x89\x20\x70\x01\x00\xa4\x3d\x21\xc5" .
1287 - "\x12\x1c\x9a\xfe\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82";
1288 -}
1289 -
1269 sub git_project_list {
1270 my $order = $cgi->param('o');
1271 if (defined $order && $order !~ m/project|descr|owner|age/) {