git3html

git clone https://orangeshoelaces.net/git/git3html.git

8f1c74d76ce2c46325d4ac54a1d9ae289965ff3c

Author: Vasilii Kolobkov on 01/15/2019

Committer: Vasilii Kolobkov on 01/15/2019

Print subject and body on commit pages

Stats

git3html | 10 ++++++--
1 file changed, 8 insertions(+), 2 deletions(-)

Patch

diff --git a/git3html b/git3html
index 7f38133..710dec7 100755
--- a/git3html
+++ b/git3html
@@ -148,18 +148,24 @@ readme() (
 
 commit() (
 	id="$1"
-	g rev-list -n 1 --date=format:%x --format='%h%n%an%n%ae%n%ad%n%cn%n%ce%n%cd' "$id" | \
+	g rev-list -n 1 --date=format:%x --format='%h%n%an%n%ae%n%ad%n%cn%n%ce%n%cd%n%s%n%b' "$id" | \
 	tail -n +2 | escape | {
 		IFS= read -r shortid
 		header "${projname} commit ${shortid}" ..
 		printf '<h2>%s<span class="id-suffix">%s</h2>\n' "$shortid" \
 			"$(echo "$id" | cut -c "$(expr ${#shortid} + 1)-")"
-		for v in an ae ad cn ce cd; do
+		for v in an ae ad cn ce cd subj; do
 			IFS= read -r "$v"
 		done
 		printf '<p>Author: <a href="mailto:%s">%s</a> on %s</p>\n' "$ae" "$an" "$ad"
 		printf '<p>Committer: <a href="mailto:%s">%s</a> on %s</p>\n' "$ce" "$cn" "$cd"
+		printf '<p>%s</p>\n' "$subj"
+		body="$(cat)"
+		if [ "${#body}" -gt 0 ]; then
+			printf '<p>%s</p>\n' "$body"
+		fi
 	}
+
 	printf '<h3>Stats</h3>\n'
 	printf '<pre><code>'
 	g diff-tree --stat --stat-graph-width=8 "$id" | tail -n +2 | escape | sed \