git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] gitweb: Cleanup Git logo and Git logo target generation

From
Junio C Hamano <junkio@cox.net>
Date
Oct 7, 2006, 08:36 UTC
Message-ID
<7viriwwmid.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<200610061231.06017.jnareb@gmail.com>
Jakub Narebski <jnareb@gmail.com> writes:
Show 8 quoted lines
> Rename $githelp_url and $githelp_label to $logo_url and $logo_label to
> be more obvious what they refer to; while at it add commented out
> previous contents (git documentation at kernel.org). Add comment about
> logo size.
>
> Use $cgi->a(...) to generate Git logo link; it automatically escapes
> attribute values when it is needed.  Escape href attribute using
> esc_url instead of (incorrect!) esc_html.

In principle, I am not sure renaming the variables is a good idea in general. Renaming them means you are burning people who have custom help link defined in their gitweb_config.perl file, so unless the new variable names are ten times better than the current one I do not think it is worth doing.

These variables, however, have never been in any official release nor -rc yet, and have only been there for exactly two weeks, so if we are going to rename them, we'd better do so now. And the variables are about the same thing described by $logo variable, so the new names probably make more sense.

Having said that, I am wondering if it is worth doing something like this:

sub img_button {
	my $it = $_[0];
	my @attr = ();
        for my $attr (qw(src width height alt class id)) {
		next unless exists $it->{$attr};
                push @attr, "$attr=\"" . esc_attr($it->{$attr}) . '"';
	}
	my $img = '<img ' . join(' ', @attr) . ' />';
	print $cgi->a({ -href => esc_url($it->{'url'}),
        		-title => esc_attr($it->{'title'}),
                      }, $img);
}
our %logo = (
	# logo image button
	src => '++GITWEB_LOGO++',
        width => 72,
        height => 27,
	alt => 'git logo',
	# where that link leads to
        url => 'http:/git.or.cz/',
	title => 'git homepage',
);
Previous: Jakub NarebskiNext: Jakub Narebski
Message 12 of 25 in “gitweb: Make the Git logo link target to point to the homepage”
  1. Petr BaudisSep 19, 2006
  2. Petr BaudisSep 23, 2006
  3. Junio C HamanoSep 23, 2006
  4. Petr BaudisSep 23, 2006
  5. Petr BaudisOct 5, 2006
  6. Junio C HamanoOct 5, 2006
  7. Junio C HamanoOct 5, 2006
  8. Petr BaudisOct 5, 2006
  9. Jakub NarebskiSep 23, 2006
  10. Junio C HamanoSep 23, 2006
  11. gitweb: Cleanup Git logo and Git logo target generationJakub Narebski, Oct 6, 2006
  12. Junio C HamanoOct 7, 2006
  13. Jakub NarebskiOct 7, 2006
  14. Alan ChandlerOct 7, 2006
  15. Jakub NarebskiOct 8, 2006
  16. Junio C HamanoOct 8, 2006
  17. Petr BaudisOct 8, 2006
  18. Junio C HamanoOct 8, 2006
  19. Jakub NarebskiOct 8, 2006
  20. Junio C HamanoOct 9, 2006
  21. Jakub NarebskiOct 9, 2006
  22. Junio C HamanoOct 9, 2006
  23. Jakub NarebskiOct 9, 2006
  24. Petr BaudisOct 9, 2006
  25. gitweb: Cleanup Git logo and Git logo target generationJakub Narebski, Oct 8, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.