Add diffstat, written by Evil_Bob. Thanks! - various - Various utilities developed at bitreich.
(HTM) git clone git://bitreich.org/various/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/various/
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) Tags
---
(DIR) commit 08ba44c39d435ca04d7ef39d7f5d5a8b783dd883
(DIR) parent 1e985cb90d976f0f4e63cf51cb6d031cc53d304e
(HTM) Author: Christoph Lohmann <20h@r-36.net>
Date: Mon, 10 Jan 2022 18:33:02 +0100
Add diffstat, written by Evil_Bob. Thanks!
Diffstat:
A diffstat | 19 +++++++++++++++++++
1 file changed, 19 insertions(+), 0 deletions(-)
---
(DIR) diff --git a/diffstat b/diffstat
@@ -0,0 +1,19 @@
+#!/bin/sh
+# script to quickly check how much is changed in a patch.
+# Written and (c) by Evil_Bob on 2022-01-10.
+
+LC_ALL=C awk '
+$0 ~ /^(\+\+\+|\-\-\-) /{
+ # likely a diff header for a file.
+ next;
+}
+length($0) {
+ c = substr($0, 1, 1);
+ if (c == "-")
+ del++;
+ else if (c == "+")
+ add++;
+}
+END {
+ printf("%d insertions(+), %d deletions(-)\n", add, del);
+}'