summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorscott Chacon <schacon@agadorsparticus.corp.reactrix.com>2007-11-20 11:53:07 -0800
committerscott Chacon <schacon@agadorsparticus.corp.reactrix.com>2007-11-20 11:53:07 -0800
commit2cef1e66c395296620225c7ffd77b772c6ad4215 (patch)
tree655e9910eb40fe6bf7a7faed6c0c2d90a187266a
parent13f7daaf27656fefe4c266e9b53a53010caf4177 (diff)
downloadthird_party-ruby-git-2cef1e66c395296620225c7ffd77b772c6ad4215.zip
third_party-ruby-git-2cef1e66c395296620225c7ffd77b772c6ad4215.tar.gz
third_party-ruby-git-2cef1e66c395296620225c7ffd77b772c6ad4215.tar.xz
added a timer to gitweb, so I can see if i'm speeding it up
took out another git call
-rw-r--r--camping/gitweb.rb12
-rw-r--r--lib/git/lib.rb7
2 files changed, 14 insertions, 5 deletions
diff --git a/camping/gitweb.rb b/camping/gitweb.rb
index b346824..092649d 100644
--- a/camping/gitweb.rb
+++ b/camping/gitweb.rb
@@ -194,7 +194,10 @@ module GitWeb::Views
script '', :type => "text/javascript", :language => "JavaScript", :src => R(JsHighlight)
end
style <<-END, :type => 'text/css'
- body { color: #333; }
+ body { font-family: verdana, arial, helvetica, sans-serif; color: #333;
+ font-size: 13px;
+ line-height: 18px;}
+
h1 { background: #cce; padding: 10px; margin: 3px; }
h3 { background: #aea; padding: 5px; margin: 3px; }
.options { float: right; margin: 10px; }
@@ -202,9 +205,14 @@ module GitWeb::Views
.odd { background: #eee; }
.tag { margin: 5px; padding: 1px 3px; border: 1px solid #8a8; background: #afa;}
.indent { padding: 0px 15px;}
+ table tr td { font-size: 13px; }
+ table.shortlog { width: 100%; }
+ .timer { color: #666; padding: 10px; margin-top: 10px; }
END
body :onload => "sh_highlightDocument();" do
+ before = Time.now().usec
self << yield
+ self << ((Time.now().usec - before).to_f / 60).to_s + ' sec'
end
end
end
@@ -233,7 +241,7 @@ module GitWeb::Views
@git.log.each do |log|
tr do
td log.date.strftime("%Y-%m-%d")
- td log.sha[0, 8]
+ td { code log.sha[0, 8] }
td { em log.author.name }
td do
span.message log.message[0, 60]
diff --git a/lib/git/lib.rb b/lib/git/lib.rb
index 256d4b6..eb06875 100644
--- a/lib/git/lib.rb
+++ b/lib/git/lib.rb
@@ -295,9 +295,10 @@ module Git
def config_remote(name)
hsh = {}
- command_lines('config', ['--get-regexp', "remote.#{name}"]).each do |line|
- (key, value) = line.split
- hsh[key.gsub("remote.#{name}.", '')] = value
+ config_list.each do |key, value|
+ if /remote.#{name}/.match(key)
+ hsh[key.gsub("remote.#{name}.", '')] = value
+ end
end
hsh
end