Skip to content

Commit 1313a81

Browse files
committed
Weekly report for 24 September 2025.
* 2025-09-24-report.md: Created. Signed-off-by: Jeremy Bennett <jeremy.bennett@embecosm.com>
1 parent 8987ba6 commit 1313a81

11 files changed

+478
-763
lines changed

count-authors-all-releases.sh

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
#!/bin/bash
2+
3+
# Script to count authors in all releases.
4+
5+
# Copyright (C) 2025 Embecosm Limited
6+
# Contributor Jeremy Bennett <jeremy.bennett@embecosm.com>
7+
8+
# SPDX-License-Identifier: GPL-3.0-or-later
9+
10+
set -u
11+
12+
usage () {
13+
echo "Usage ${cmd}"
14+
cat <<EOF
15+
<name> : Description of this run for reporting
16+
<colname> : Name of the column in the CSV file
17+
<dir> : Top directory of checked out repository
18+
<csvfile> : CSV file where the results should go
19+
<prefix> : Prefix to turn a release into a branch name
20+
<rels> : Space separated list of release branches
21+
<suffix> : Suffix to turn a release into a branch name
22+
<logdir> : The log directory
23+
[<args>] : Optional list of directories for which commits are wanted
24+
25+
Note. <rels> is a single argument, so will typically need quoting.
26+
EOF
27+
}
28+
29+
cmd="$0"
30+
tooldir="$(cd $(dirname ${cmd}) && echo $PWD)"
31+
32+
if [[ $# -lt 8 ]]
33+
then
34+
usage >&2
35+
exit 1
36+
fi
37+
38+
name=$1
39+
shift
40+
colname=$1
41+
shift
42+
gitdir="$(realpath $1)"
43+
shift
44+
csvf="$(realpath $1)"
45+
shift
46+
prefix="$1"
47+
shift
48+
rels="$1"
49+
shift
50+
suffix="$1"
51+
shift
52+
logdir="$1"
53+
shift
54+
args="$*"
55+
56+
# Commits per release
57+
echo "Getting data for ${name}"
58+
printf "%s,%s\n" "${colname}" "# commits" > ${csvf}
59+
60+
# We keep a log of the detailed info
61+
mkdir -p ${logdir}
62+
63+
prev_br=
64+
for r in ${rels}
65+
do
66+
logf="${logdir}/count-authors-${name}-${r}.log"
67+
br="${prefix}${r}${suffix}"
68+
num=$(${tooldir}/count-authors-one-release.sh ${gitdir} "${br}" \
69+
"${prev_br}" "${logf}" ${args})
70+
printf "%s,%d\n" "${r}" ${num} >> ${csvf}
71+
prev_br="${br}"
72+
echo -n "."
73+
done
74+
75+
echo

count-authors-one-release.sh

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
#!/bin/bash -e
2+
3+
# Script to count authors in one release.
4+
5+
# Copyright (C) 2025 Embecosm Limited
6+
# Contributor Jeremy Bennett <jeremy.bennett@embecosm.com>
7+
8+
# SPDX-License-Identifier: GPL-3.0-or-later
9+
10+
# The general premise is that this counts authors that are in one branch, but
11+
# not another for a repository.
12+
13+
set -u
14+
15+
usage () {
16+
echo "Usage ${cmd}"
17+
cat <<EOF
18+
<dir> : Top directory of checked out repository
19+
<br1> : Include all commits in this branch, but not <br2>
20+
<br2> : Exclude all commits in this branch
21+
[<args>] : Optional list of directories for which commits are wanted
22+
23+
If <br2> is empty, then no commits from <br1> are excluded. <args> are
24+
optional, and if missing, all commits in the repo are considered.
25+
EOF
26+
}
27+
28+
cmd=$0
29+
30+
if [[ $# -lt 3 ]]
31+
then
32+
usage >&2
33+
exit 1
34+
fi
35+
36+
# Get args
37+
gitdir="$(realpath $1)"
38+
shift
39+
br1="$1"
40+
shift
41+
br2="$1"
42+
shift
43+
logf="$1"
44+
shift
45+
args="$*"
46+
47+
# Repo to work in
48+
cd "${gitdir}" > /dev/null 2>&1
49+
50+
# First release is special
51+
if [[ "x${br2}" == "x" ]]
52+
then
53+
git log --no-merges "${br1}" --pretty="format:%an" ${args} | sort | \
54+
uniq -c | sort -n -k1 | grep -v "CVS to SVN Conversion" > ${logf} 2>&1
55+
num=$(wc -l --total=only ${logf})
56+
else
57+
git log --no-merges "${br1}" ^"${br2}" \
58+
--pretty="format:%an" ${args} | sort | uniq -c | sort -n -k1 | \
59+
grep -v "CVS to SVN Conversion" > ${logf} 2>&1
60+
num=$(wc -l --total=only ${logf})
61+
fi
62+
echo "${num}"

count-authors-per-release.sh

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#!/bin/bash -e
2+
3+
# Script to count authors in each project release.
4+
5+
# Copyright (C) 2025 Embecosm Limited
6+
# Contributor Jeremy Bennett <jeremy.bennett@embecosm.com>
7+
8+
# SPDX-License-Identifier: GPL-3.0-or-later
9+
10+
set -u
11+
12+
# Top level directories
13+
cmd=$(basename $0)
14+
tooldir="$(cd "$(dirname "$0")" && echo "$PWD")"
15+
16+
# Get the arguments
17+
default_title_prefix="Authors"
18+
default_data_prefix="authors-per-release"
19+
default_image_prefix="authors-per-release"
20+
default_xmm=119.0
21+
default_ymm=109.2
22+
23+
source ${tooldir}/get-args.sh
24+
25+
# Create the data (optional)
26+
colname="${nameuc} release"
27+
if ${getdata}
28+
then
29+
# Create the list of current releases, along with branch prefix and suffix
30+
source "${tooldir}/gen-rels-${namelc}.sh"
31+
${tooldir}/count-authors-all-releases.sh "${namelc}" "${colname}" \
32+
"${repodir}" "${csvf}" "${prefix}" "${rels}" "${suffix}" "${logdir}" \
33+
${args}
34+
fi
35+
36+
# Plot the graph (optional)
37+
if ${doplot}
38+
then
39+
echo "Plotting graph"
40+
xpx=$(python3 -c "print(int(${xmm} / 25.4 * ${dpi}))")
41+
ypx=$(python3 -c "print(int(${ymm} / 25.4 * ${dpi}))")
42+
43+
gnuplot ${persist} \
44+
-e "csvf='${csvf}'" \
45+
-e "outf='${outf}'" \
46+
-e "xcol='${colname}'" \
47+
-e "ycol='# authors'" \
48+
-e "xpx=${xpx}" \
49+
-e "ypx=${ypx}" \
50+
-e "fontscale=${fontscale}" \
51+
-e "title='${title}'" \
52+
${tooldir}/plot-one-line.gnuplot
53+
fi

count-authors.sh

Lines changed: 0 additions & 181 deletions
This file was deleted.

count-commits-one-release.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,8 @@
77

88
# SPDX-License-Identifier: GPL-3.0-or-later
99

10-
# The general premise is that this counts commits that are in one branch, but not
11-
# another for a repository. It has the general form
12-
13-
#
10+
# The general premise is that this counts commits that are in one branch, but
11+
# not another for a repository.
1412

1513
set -u
1614

0 commit comments

Comments
 (0)