git3html

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

bc71944de47635772944ae7deea994367d93eb58

Author: Vasilii Kolobkov on 01/14/2019

Committer: Vasilii Kolobkov on 01/14/2019

Mark adds and deletes in patches

Stats

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

Patch

diff --git a/git3html b/git3html
index 38cb341..4e63b4b 100755
--- a/git3html
+++ b/git3html
@@ -174,10 +174,12 @@ commit() (
 	<pre>
 	<code>
 	END
-	g diff-tree -p "$id" | escape | sed "\
+	g diff-tree -p "$id" | tail -n +2 | escape | sed "\
 		$(for p in diff old new deleted copy rename similarity dissimilarity index; do
 			echo "/^$p/ { s,^,<span class=\"hunk-header\">,; s,$,</span>,; }"
-		done;)"
+		done;)
+		/^+/ { s,^,<span class=\"add\">,; s,$,</span>,; }
+		/^-/ { s,^,<span class=\"delete\">,; s,$,</span>,; }"
 	cat <<-END
 	</code>
 	</pre>