summaryrefslogtreecommitdiff
path: root/scripts/delta
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2022-02-03 23:42:02 +0100
committerDaniel Stenberg <daniel@haxx.se>2022-02-03 23:42:43 +0100
commit5ad5007eba76ac9db0c5376cb8dd673a0da81326 (patch)
tree623e616bb404b9ed864750b7a2478b1131c54aea /scripts/delta
parent2cb0eaba75363a7d8f3801218f415f9be1436b55 (diff)
downloadcurl-5ad5007eba76ac9db0c5376cb8dd673a0da81326.tar.gz
scripts/delta: check the file delta for current branch
... also polish the output style a little bit
Diffstat (limited to 'scripts/delta')
-rwxr-xr-xscripts/delta24
1 files changed, 18 insertions, 6 deletions
diff --git a/scripts/delta b/scripts/delta
index bc1681fad..cb246e445 100755
--- a/scripts/delta
+++ b/scripts/delta
@@ -6,7 +6,7 @@
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
-# Copyright (C) 2018-2021, Daniel Stenberg, <daniel@haxx.se>, et al.
+# Copyright (C) 2018-2022, Daniel Stenberg, <daniel@haxx.se>, et al.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
@@ -66,10 +66,13 @@ $aoptions=`grep -c '{"....--' src/tool_listhelp.c`;
$boptions=`git show $start:src/tool_listhelp.c 2>/dev/null | grep -c '{"....--'`;
$noptions=$aoptions - $boptions;
+# current local branch
+$branch=`git rev-parse --abbrev-ref HEAD 2>/dev/null`;
+chomp $branch;
# Number of files in git
$afiles=`git ls-files | wc -l`;
-$deletes=`git diff-tree --diff-filter=A -r --summary origin/master $start | wc -l`;
-$creates=`git diff-tree --diff-filter=D -r --summary origin/master $start | wc -l`;
+$deletes=`git diff-tree --diff-filter=A -r --summary origin/$branch $start | wc -l`;
+$creates=`git diff-tree --diff-filter=D -r --summary origin/$branch $start | wc -l`;
# Time since that tag
$tagged=`git for-each-ref --format="%(refname:short) | %(taggerdate:unix)" refs/tags/* | grep ^$start | cut "-d|" -f2`; # unix timestamp
@@ -86,6 +89,9 @@ $public = $apublic - $bpublic;
# diffstat
$diffstat=`git diff --stat $start.. | tail -1`;
+if($diffstat =~ /^ *(\d+) files changed, (\d+) insertions\(\+\), (\d+)/) {
+ ($fileschanged, $insertions, $deletions)=($1, $2, $3);
+}
# Changes/bug-fixes currently logged
open(F, "<RELEASE-NOTES");
@@ -137,6 +143,12 @@ printf "New command line options: %d (total %d)\n",
$noptions, $aoptions;
printf "Changes logged: %d\n", $numchanges;
printf "Bugfixes logged: %d\n", $numbugfixes;
-printf "Deleted %d files, added %d files (total %d)\n",
- $deletes, $creates, $afiles;
-print "Diffstat:$diffstat";
+printf "Added files: %d (total %d)\n",
+ $creates, $afiles;
+printf "Deleted files: %d (delta: %d)\n", $deletes,
+ $creates - $deletes;
+print "Diffstat:$diffstat" if(!$fileschanged);
+printf "Files changed: %d\n", $fileschanged;
+printf "Lines inserted: %d\n", $insertions;
+printf "Lines deleted: %d (delta: %d)\n", $deletions,
+ $insertions - $deletions;