From: Daniel Stenberg Date: Thu, 3 Feb 2022 22:42:02 +0000 (+0100) Subject: scripts/delta: check the file delta for current branch X-Git-Tag: curl-7_82_0~131 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5ad5007eba76ac9db0c5376cb8dd673a0da81326;p=thirdparty%2Fcurl.git scripts/delta: check the file delta for current branch ... also polish the output style a little bit --- diff --git a/scripts/delta b/scripts/delta index bc1681fadd..cb246e445a 100755 --- a/scripts/delta +++ b/scripts/delta @@ -6,7 +6,7 @@ # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # -# Copyright (C) 2018-2021, Daniel Stenberg, , et al. +# Copyright (C) 2018-2022, Daniel Stenberg, , 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, "