From: John 'Warthog9' Hawley Date: Thu, 09 Dec 2010 21:57:19 GMT Subject: [PATCH 13/18] gitweb: Add commented url & url hash to page footer Message-ID: <1291931844-28454-14-git-send-email-warthog9@eaglescrag.net> In-Reply-To: <1291931844-28454-1-git-send-email-warthog9@eaglescrag.net> This is mostly a debugging tool, but it adds a small bit of information to the footer: The first bit tells you what the url that generated the page actually was, the second is the hash used to store the file with the first two characters being used as the directory: /7a/31cfb8a43f5643679eec88aa9d7981 Also useful for greping through the existing cache and finding files with unique paths that you may want to explicitly flush. Signed-off-by: John 'Warthog9' Hawley --- gitweb/gitweb.perl | 7 +++++++ gitweb/lib/cache.pl | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index e8c028b..7f8292e 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -303,6 +303,9 @@ our $fullhashpath = *STDOUT; our $fullhashbinpath = *STDOUT; our $fullhashbinpathfinal = *STDOUT; +our $full_url; +our $urlhash; + # configuration for 'highlight' (http://www.andre-simon.de/) # match by basename our %highlight_basename = ( @@ -3663,6 +3666,10 @@ sub git_footer_html { print "
\n"; print "
Cache Last Updated: ". gmtime( time ) ." GMT
\n"; + print "\n" if ($cache_enable); if (defined $project) { my $descr = git_get_project_description($project); if (defined $descr) { diff --git a/gitweb/lib/cache.pl b/gitweb/lib/cache.pl index fafc028..63dbe9e 100644 --- a/gitweb/lib/cache.pl +++ b/gitweb/lib/cache.pl @@ -30,8 +30,8 @@ sub cache_fetch { print "Cache directory created successfully\n"; } - our $full_url = "$my_url?". $ENV{'QUERY_STRING'}; - our $urlhash = md5_hex($full_url); + $full_url = "$my_url?". $ENV{'QUERY_STRING'}; + $urlhash = md5_hex($full_url); our $fullhashdir = "$cachedir/". substr( $urlhash, 0, 2) ."/"; eval { mkpath( $fullhashdir, 0, 0777 ) }; -- 1.7.2.3