git3html

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

608414b0ad921a26ce69466b20130852863017a4

Author: Vasilii Kolobkov on 01/15/2019

Committer: Vasilii Kolobkov on 01/15/2019

Mark off +/- in the stats summary with zeal

Stats

git3html | 9 ++++++--
1 file changed, 7 insertions(+), 2 deletions(-)

Patch

diff --git a/git3html b/git3html
index 48b35e1..f1f5bee 100755
--- a/git3html
+++ b/git3html
@@ -175,8 +175,13 @@ commit() (
 	printf '<h3>Stats</h3>\n'
 	printf '<pre><code>'
 	g diff-tree --stat --stat-graph-width=8 "$id" | tail -n +2 | escape | sed \
-		's/^[[:space:]]*//;
-		s#\(+*\)\(-*\)$#<span class="add">\1</span><span class="delete">\2</span>#'
+		'$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 \
+		's,+,<span class="add">+</span>,;
+		s,-,<span class="delete">-</span>,;
+		s/^[[:space:]]*//;'
 	printf '</code></pre>\n'
 	printf '<h3>Patch</h3>\n'
 	printf '<pre><code>'