git3html

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

6ff2d28e70261482b790c084bf0f8955dc3e2d03

Author: Vasilii Kolobkov on 01/15/2019

Committer: Vasilii Kolobkov on 01/15/2019

Do git-diff-tree's with --root option to work for initial commits as well

Stats

git3html | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

Patch

diff --git a/git3html b/git3html
index b6b0d58..631c916 100755
--- a/git3html
+++ b/git3html
@@ -175,18 +175,18 @@ commit() (
 
 	printf '<h3>Stats</h3>\n'
 	printf '<pre><code>'
-	g diff-tree --stat --stat-graph-width=8 "$id" | tail -n +2 | escape | sed \
+	g diff-tree --stat --stat-graph-width=8 --root "$id" | tail -n +2 | escape | sed \
 		'$d;
 		s#\(+*\)\(-*\)$#<span class="add">\1</span><span class="delete">\2</span>#
 		s/^[[:space:]]*//;'
-	g diff-tree --stat --stat-graph-width=8 "$id" | tail -n 1 | escape | sed \
+	g diff-tree --stat --stat-graph-width=8 --root "$id" | tail -n 1 | escape | sed \
 		's,+,<span class="add">+</span>,;
 		s,-,<span class="delete">-</span>,;
 		s/^[[:space:]]*//;'
 	printf '</code></pre>\n'
 	printf '<h3>Patch</h3>\n'
 	printf '<pre><code>'
-	g diff-tree -p "$id" | tail -n +2 | escape | sed "\
+	g diff-tree -p --root "$id" | tail -n +2 | escape | sed "\
 		$(for p in diff old new deleted copy rename similarity dissimilarity index; do
 			echo "/^$p/ { s,^,<span class=\"diff-header\">,; s,$,</span>,; }"
 		done;)