2021-08-21 18:57:11 +08:00
|
|
|
#!/usr/bin/env perl
|
2018-12-11 22:06:21 +08:00
|
|
|
#***************************************************************************
|
|
|
|
# _ _ ____ _
|
|
|
|
# Project ___| | | | _ \| |
|
|
|
|
# / __| | | | |_) | |
|
|
|
|
# | (__| |_| | _ <| |___
|
|
|
|
# \___|\___/|_| \_\_____|
|
|
|
|
#
|
2022-02-04 06:42:02 +08:00
|
|
|
# Copyright (C) 2018-2022, Daniel Stenberg, <daniel@haxx.se>, et al.
|
2018-12-11 22:06:21 +08:00
|
|
|
#
|
|
|
|
# This software is licensed as described in the file COPYING, which
|
|
|
|
# you should have received as part of this distribution. The terms
|
2020-11-04 21:02:01 +08:00
|
|
|
# are also available at https://curl.se/docs/copyright.html.
|
2018-12-11 22:06:21 +08:00
|
|
|
#
|
|
|
|
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
|
|
|
# copies of the Software, and permit persons to whom the Software is
|
|
|
|
# furnished to do so, under the terms of the COPYING file.
|
|
|
|
#
|
|
|
|
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
# KIND, either express or implied.
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: curl
|
2022-05-17 17:16:50 +08:00
|
|
|
#
|
2018-12-11 22:06:21 +08:00
|
|
|
###########################################################################
|
|
|
|
|
2019-04-01 04:39:29 +08:00
|
|
|
# Display changes done in the repository from [tag] until now.
|
2018-12-11 22:06:21 +08:00
|
|
|
#
|
|
|
|
# Uses git for repo data.
|
|
|
|
# Uses docs/THANKS and RELEASE-NOTES for current status.
|
|
|
|
#
|
|
|
|
# In the git clone root, invoke 'scripts/delta [release tag]'
|
|
|
|
|
|
|
|
$start = $ARGV[0];
|
|
|
|
|
2020-02-05 14:48:18 +08:00
|
|
|
if($start eq "-h") {
|
2018-12-11 22:06:21 +08:00
|
|
|
print "Usage: summary [tag]\n";
|
|
|
|
exit;
|
|
|
|
}
|
2020-02-05 14:48:18 +08:00
|
|
|
elsif($start eq "") {
|
2020-08-27 20:25:24 +08:00
|
|
|
$start = `git tag --sort=taggerdate | grep "^curl-" | tail -1`;
|
2020-02-05 14:48:18 +08:00
|
|
|
chomp $start;
|
|
|
|
}
|
2018-12-11 22:06:21 +08:00
|
|
|
|
|
|
|
$commits = `git log --oneline $start.. | wc -l`;
|
|
|
|
$committers = `git shortlog -s $start.. | wc -l`;
|
|
|
|
$bcommitters = `git shortlog -s $start | wc -l`;
|
|
|
|
|
|
|
|
$acommits = `git log --oneline | wc -l`;
|
|
|
|
$acommitters = `git shortlog -s | wc -l`;
|
|
|
|
|
|
|
|
# delta from now compared to before
|
|
|
|
$ncommitters = $acommitters - $bcommitters;
|
|
|
|
|
2020-02-05 14:48:18 +08:00
|
|
|
# number of contributors right now
|
|
|
|
$acontribs = `./scripts/contrithanks.sh | grep -c '^[^ ]'`;
|
2018-12-11 22:06:21 +08:00
|
|
|
# number when the tag tag was set
|
|
|
|
$bcontribs = `git show $start:docs/THANKS | grep -c '^[^ ]'`;
|
|
|
|
# delta
|
|
|
|
$contribs = $acontribs - $bcontribs;
|
|
|
|
|
|
|
|
# number of setops:
|
2020-01-07 15:30:59 +08:00
|
|
|
$asetopts=`grep '^ CURLOPT(' include/curl/curl.h | grep -cv OBSOLETE`;
|
|
|
|
$bsetopts=`git show $start:include/curl/curl.h | grep '^ CURLOPT(' | grep -cv OBSOLETE`;
|
2018-12-11 22:06:21 +08:00
|
|
|
$nsetopts = $asetopts - $bsetopts;
|
|
|
|
|
|
|
|
# Number of command line options:
|
2021-10-01 14:49:12 +08:00
|
|
|
$aoptions=`grep -c '{"....--' src/tool_listhelp.c`;
|
2021-10-03 05:36:00 +08:00
|
|
|
$boptions=`git show $start:src/tool_listhelp.c 2>/dev/null | grep -c '{"....--'`;
|
2018-12-11 22:06:21 +08:00
|
|
|
$noptions=$aoptions - $boptions;
|
|
|
|
|
2022-02-04 06:42:02 +08:00
|
|
|
# current local branch
|
|
|
|
$branch=`git rev-parse --abbrev-ref HEAD 2>/dev/null`;
|
|
|
|
chomp $branch;
|
2018-12-11 22:06:21 +08:00
|
|
|
# Number of files in git
|
|
|
|
$afiles=`git ls-files | wc -l`;
|
2022-02-04 06:42:02 +08:00
|
|
|
$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`;
|
2018-12-11 22:06:21 +08:00
|
|
|
|
|
|
|
# Time since that tag
|
|
|
|
$tagged=`git for-each-ref --format="%(refname:short) | %(taggerdate:unix)" refs/tags/* | grep ^$start | cut "-d|" -f2`; # unix timestamp
|
|
|
|
$taggednice=`git for-each-ref --format="%(refname:short) | %(creatordate)" refs/tags/* | grep ^$start | cut '-d|' -f2`; # human readable time
|
|
|
|
chomp $taggednice;
|
|
|
|
$now=`date +%s`;
|
|
|
|
$elapsed=$now - $tagged; # number of seconds since tag
|
2021-05-06 16:00:36 +08:00
|
|
|
$total=$now - `date -d 19980320 +%s`;
|
2018-12-11 22:06:21 +08:00
|
|
|
|
|
|
|
# Number of public functions in libcurl
|
|
|
|
$apublic=`git grep ^CURL_EXTERN -- include/curl | wc -l`;
|
|
|
|
$bpublic=`git grep ^CURL_EXTERN $start -- include/curl | wc -l`;
|
|
|
|
$public = $apublic - $bpublic;
|
|
|
|
|
2020-09-03 14:18:32 +08:00
|
|
|
# diffstat
|
|
|
|
$diffstat=`git diff --stat $start.. | tail -1`;
|
2022-02-04 06:42:02 +08:00
|
|
|
if($diffstat =~ /^ *(\d+) files changed, (\d+) insertions\(\+\), (\d+)/) {
|
|
|
|
($fileschanged, $insertions, $deletions)=($1, $2, $3);
|
|
|
|
}
|
2020-09-03 14:18:32 +08:00
|
|
|
|
2019-04-01 04:39:29 +08:00
|
|
|
# Changes/bug-fixes currently logged
|
2018-12-11 22:06:21 +08:00
|
|
|
open(F, "<RELEASE-NOTES");
|
|
|
|
while(<F>) {
|
|
|
|
if($_ =~ /following changes:/) {
|
|
|
|
$mode=1;
|
|
|
|
}
|
|
|
|
elsif($_ =~ /following bugfixes:/) {
|
|
|
|
$mode=2;
|
|
|
|
}
|
|
|
|
elsif($_ =~ /known bugs:/) {
|
|
|
|
$mode=3;
|
|
|
|
}
|
|
|
|
elsif($_ =~ /like these:/) {
|
|
|
|
$mode=4;
|
|
|
|
}
|
|
|
|
if($_ =~ /^ o /) {
|
|
|
|
if($mode == 1) {
|
|
|
|
$numchanges++;
|
|
|
|
}
|
|
|
|
elsif($mode == 2) {
|
|
|
|
$numbugfixes++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(($mode == 4) && ($_ =~ /^ \((\d+) contributors/)) {
|
|
|
|
$numcontributors = $1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
close(F);
|
|
|
|
|
|
|
|
########################################################################
|
|
|
|
# Produce the summary
|
|
|
|
|
2020-09-03 14:18:32 +08:00
|
|
|
print "== Since $start $taggednice ==\n";
|
2021-05-06 16:00:36 +08:00
|
|
|
printf "Elapsed time: %.1f days (total %d)\n",
|
|
|
|
$elapsed / 3600 / 24,
|
|
|
|
$total / 3600 / 24;
|
|
|
|
printf "Commits: %d (total %d)\n",
|
2018-12-11 22:06:21 +08:00
|
|
|
$commits, $acommits;
|
2020-09-03 14:18:32 +08:00
|
|
|
printf "Commit authors: %d, %d new (total %d)\n",
|
2018-12-11 22:06:21 +08:00
|
|
|
$committers, $ncommitters, $acommitters;
|
2020-09-03 14:18:32 +08:00
|
|
|
printf "Contributors: %d, %d new (total %d)\n",
|
|
|
|
$numcontributors, $contribs, $acontribs;
|
|
|
|
printf "New public functions: %d (total %d)\n",
|
|
|
|
$public, $apublic;
|
|
|
|
printf "New curl_easy_setopt() options: %d (total %d)\n",
|
2018-12-11 22:06:21 +08:00
|
|
|
$nsetopts, $asetopts;
|
2020-09-03 14:18:32 +08:00
|
|
|
printf "New command line options: %d (total %d)\n",
|
2018-12-11 22:06:21 +08:00
|
|
|
$noptions, $aoptions;
|
2020-09-03 14:18:32 +08:00
|
|
|
printf "Changes logged: %d\n", $numchanges;
|
|
|
|
printf "Bugfixes logged: %d\n", $numbugfixes;
|
2022-02-04 06:42:02 +08:00
|
|
|
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;
|