Browse files

Use.git/description if it's not the default.

  • Loading branch information...
1 parent 820ee22 commit 7a6ba400e85706fae0c6de5e119366454f052651 @dustin committed Jan 17, 2009
Showing with 15 additions and 2 deletions.
  1. +15 −2 git-htmlchangelog
View
17 git-htmlchangelog
@@ -1,5 +1,7 @@
#!/usr/bin/env python
+from __future__ import with_statement
+
import sys
import subprocess
@@ -38,13 +40,22 @@ if __name__ == '__main__':
sys.stderr.write("Need to list some tag objects.\n")
sys.exit(1)
+ title = "Changelog"
+ try:
+ with open(".git/description") as f:
+ desc = f.read().strip()
+ if not desc.startswith("Unnamed repository"):
+ title= "Changelog for " + desc
+ except:
+ pass
+
print """<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
- <title>Changelog</title>
+ <title>%s</title>
<style type="text/css">
.pie {
float: right;
@@ -56,7 +67,9 @@ if __name__ == '__main__':
</head>
<body>
-"""
+""" % title
+
+ print "<h1>%s</h1>" % title
prev = ''

0 comments on commit 7a6ba40

Please sign in to comment.