gitweb: Refactor syntax highlighting support
authorJakub Narebski <jnareb@gmail.com>
Tue, 27 Apr 2010 19:34:45 +0000 (21:34 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 3 May 2010 16:38:54 +0000 (09:38 -0700)
This refactoring (adding guess_file_syntax and run_highlighter
subroutines) is meant to make it easier in the future to add support
for other syntax highlighing solutions, or make it smarter by not
re-running `git cat-file` second time.

Instead of looping over list of regexps (keys of %highlight_type hash),
make use of the fact that choosing syntax is based either on full
basename (%highlight_basename), or on file extension (%highlight_ext).

Add some basic test of syntax highlighting (with 'highlight' as
prerequisite) to t/t9500-gitweb-standalone-no-errors.sh test.

While at it make git_blob Perl style prettier.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Acked-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
No differences found