[PATCH] gitweb: use monospace font for commit messages

Gregory Szorc gregory.szorc at gmail.com
Sat Mar 25 02:52:59 UTC 2017


# HG changeset patch
# User Gregory Szorc <gregory.szorc at gmail.com>
# Date 1490410363 25200
#      Fri Mar 24 19:52:43 2017 -0700
# Node ID 263ba0659a79f434eb57ebd1d94ffdf9828b17eb
# Parent  aea8ec3f7dd1967a05ecce8f779e16f7ad14fdee
gitweb: use monospace font for commit messages

Commit messages often contain vertically aligned text. The default
paper style already uses monospace fonts for rendering commit messages.
And, AFAICT, a number of Git servers also render commit messages
with monospace. It seems like the reasonable thing to do.

This commit converts all instances of the full commit message
in the gitweb style to render with monospace.

diff --git a/mercurial/templates/gitweb/changelogentry.tmpl b/mercurial/templates/gitweb/changelogentry.tmpl
--- a/mercurial/templates/gitweb/changelogentry.tmpl
+++ b/mercurial/templates/gitweb/changelogentry.tmpl
@@ -7,7 +7,7 @@
 </div>
 <i>{author|obfuscate} [{date|rfc822date}] rev {rev}</i><br/>
 </div>
-<div class="log_body">
+<div class="log_body description">
 {desc|strip|escape|websub|addbreaks|nonempty}
 <br/>
 <br/>
diff --git a/mercurial/templates/gitweb/changeset.tmpl b/mercurial/templates/gitweb/changeset.tmpl
--- a/mercurial/templates/gitweb/changeset.tmpl
+++ b/mercurial/templates/gitweb/changeset.tmpl
@@ -43,7 +43,7 @@ changeset |
 {child%changesetchild}
 </table></div>
 
-<div class="page_body">
+<div class="page_body description">
 {desc|strip|escape|websub|addbreaks|nonempty}
 </div>
 <div class="list_head"></div>
diff --git a/mercurial/templates/gitweb/fileannotate.tmpl b/mercurial/templates/gitweb/fileannotate.tmpl
--- a/mercurial/templates/gitweb/fileannotate.tmpl
+++ b/mercurial/templates/gitweb/fileannotate.tmpl
@@ -59,7 +59,7 @@ annotate |
 </table>
 </div>
 
-<div class="page_path">
+<div class="page_path description">
 {desc|strip|escape|websub|addbreaks|nonempty}
 </div>
 <div class="page_body">
diff --git a/mercurial/templates/gitweb/filerevision.tmpl b/mercurial/templates/gitweb/filerevision.tmpl
--- a/mercurial/templates/gitweb/filerevision.tmpl
+++ b/mercurial/templates/gitweb/filerevision.tmpl
@@ -59,7 +59,7 @@ file |
 </table>
 </div>
 
-<div class="page_path">
+<div class="page_path description">
 {desc|strip|escape|websub|addbreaks|nonempty}
 </div>
 
diff --git a/mercurial/templates/static/style-gitweb.css b/mercurial/templates/static/style-gitweb.css
--- a/mercurial/templates/static/style-gitweb.css
+++ b/mercurial/templates/static/style-gitweb.css
@@ -145,6 +145,10 @@ pre.sourcelines.stripes > span:target {
 	background-color: #bfdfff;
 }
 
+.description {
+    font-family: monospace;
+}
+
 /* Graph */
 div#wrapper {
 	position: relative;
diff --git a/tests/test-hgweb.t b/tests/test-hgweb.t
--- a/tests/test-hgweb.t
+++ b/tests/test-hgweb.t
@@ -337,7 +337,7 @@ static file
 
   $ get-with-headers.py --twice localhost:$HGPORT 'static/style-gitweb.css' - date etag server
   200 Script output follows
-  content-length: 6986
+  content-length: 7032
   content-type: text/css
   
   body { font-family: sans-serif; font-size: 12px; border:solid #d9d8d1; border-width:1px; margin:10px; background: white; color: black; }
@@ -487,6 +487,10 @@ static file
   	background-color: #bfdfff;
   }
   
+  .description {
+      font-family: monospace;
+  }
+  
   /* Graph */
   div#wrapper {
   	position: relative;


More information about the Mercurial-devel mailing list