devtools: add --markdown output to credit for release notes
What changed, and why it matters
This commit is a harmless developer tooling improvement. It adds a new --markdown option to a helper script that generates contributor lists for release notes, and updates the release checklist to use it. There is no security relevance.
No security action needed. This is a routine tooling/documentation change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch modifies devtools/credit, a shell script used by maintainers to produce contributor statistics between Git tags. It replaces a single –verbose flag with a loop supporting both –verbose and –markdown, disambiguates tag references via refs/tags/, and adds Markdown-formatted output. The second file is documentation only. No code reachable by nodes, wallets, or network peers is changed.
Changed components
devtools/credit (release-note helper script)doc/contribute-to-core-lightning/release-checklist.md (documentation)Inspect captured patch +77 / −14
diff --git a/devtools/credit b/devtools/credit
index 6036c115..de230229 100755
--- a/devtools/credit
+++ b/devtools/credit
@@ -1,28 +1,59 @@
#! /bin/sh
VERBOSE=false
+MARKDOWN=false
-if [ x"$1" = x"--verbose" ]; then
- VERBOSE=true
+while [ $# -gt 0 ]; do
+ case "$1" in
+ --verbose)
+ VERBOSE=true
+ ;;
+ --markdown)
+ MARKDOWN=true
+ ;;
+ -*)
+ echo "Usage: $0 [--verbose] [--markdown] <last-tag>" >&2
+ exit 1
+ ;;
+ *)
+ if [ -n "$PREV_TAG" ]; then
+ echo "Usage: $0 [--verbose] [--markdown] <last-tag>" >&2
+ exit 1
+ fi
+ PREV_TAG="$1"
+ ;;
+ esac
shift
-fi
+done
-if [ "$#" != 1 ]; then
- echo "Usage: $0 [--verbose] <last-tag>" >&2
+if [ -z "$PREV_TAG" ]; then
+ echo "Usage: $0 [--verbose] [--markdown] <last-tag>" >&2
exit 1
fi
-PREV_TAG="$1"
-if [ -z $(git tag -l "$PREV_TAG") ]; then
- echo "Error: couldn't find tag '$PREV_TAG'!"
+if [ -z "$(git tag -l "$PREV_TAG")" ]; then
+ echo "Error: couldn't find tag '$PREV_TAG'!" >&2
exit 1
fi
+
+# Avoid ambiguity with branch names like v26.04.
+if git show-ref --tags --quiet --verify "refs/tags/$PREV_TAG"; then
+ PREV_TAG="refs/tags/$PREV_TAG"
+fi
+
git log "$PREV_TAG".. --format="%an|%ae" | sort | uniq -c | sort -rn > /tmp/authors.$$
sed -n 's/.*[Nn]amed by //p' < CHANGELOG.md | sed 's/(.*)//' | tr -dc '[:alnum:][:space:]' > /tmp/namers.$$
git log "$PREV_TAG" --format="%an|%ae" | sort -u > /tmp/prev-authors.$$
# Include aliases
printf "Alex Myers\nShahanaFarooqui\nMatt Whitlock\nSangbida Chaudhuri\n" >> /tmp/namers.$$
+display_tag=${PREV_TAG#refs/tags/}
+if $MARKDOWN; then
+ MARKDOWN_OUT=/tmp/markdown.$$
+ HAS_NEWCOMMITTERS=false
+ : > "$MARKDOWN_OUT"
+fi
+
NAMER=""
BACKUP_NAMER=""
TOTAL=0
@@ -33,7 +64,7 @@ while read LINE; do
NAME=${LINE%%|*}
EMAIL=${LINE#*|}
NOTES=""
- if [ $(grep -ci -- "$NAME\|$EMAIL" /tmp/prev-authors.$$) = 0 ]; then
+ if [ "$(grep -ci -- "$NAME\|$EMAIL" /tmp/prev-authors.$$)" = 0 ]; then
NOTES="$NOTES""NEW COMMITTER "
fi
# ZmnSCPxj gave himself a surname!
@@ -49,13 +80,45 @@ while read LINE; do
NOTES="$NOTES""*BACKUP NAMER* "
fi
fi
- if [ -n "$NOTES" ] || $VERBOSE; then
+ if $MARKDOWN; then
+ case "$EMAIL" in
+ *@users.noreply.github.com)
+ HANDLE=$(echo "$EMAIL" | sed -n 's/.*+\([^@]*\)@users.noreply.github.com/\1/p')
+ if [ -z "$HANDLE" ]; then
+ HANDLE=$(echo "$EMAIL" | sed 's/@users.noreply.github.com//')
+ fi
+ DISPLAY="@$HANDLE"
+ ;;
+ *)
+ DISPLAY="$NAME"
+ ;;
+ esac
+ if echo "$NOTES" | grep -q "NEW COMMITTER"; then
+ echo "- $DISPLAY ($COUNT commits, *)" >> "$MARKDOWN_OUT"
+ HAS_NEWCOMMITTERS=true
+ else
+ echo "- $DISPLAY ($COUNT commits)" >> "$MARKDOWN_OUT"
+ fi
+ elif [ -n "$NOTES" ] || $VERBOSE; then
echo " - $COUNT $NAME $EMAIL $NOTES"
fi
done < /tmp/authors.$$
DAYS=$(( ( $(date +%s) - $(git log "$PREV_TAG" --format=%at | head -n1) ) / (3600*24) ))
-AUTHORS=$(cat /tmp/authors.$$ | wc -l)
-echo "$TOTAL commits in $DAYS days by $AUTHORS authors"
+AUTHORS=$(wc -l < /tmp/authors.$$ | tr -d ' ')
+if $MARKDOWN; then
+ echo "## Since **$display_tag** we've had $TOTAL commits in $DAYS days by $AUTHORS authors"
+ echo
+ echo "### Contributors (ordered from most to fewest commits)"
+ echo
+ cat "$MARKDOWN_OUT"
+ if $HAS_NEWCOMMITTERS; then
+ echo
+ echo "* Special thanks to our first-time contributors"
+ fi
+ rm "$MARKDOWN_OUT"
+else
+ echo "$TOTAL commits in $DAYS days by $AUTHORS authors"
+fi
rm /tmp/authors.$$ /tmp/namers.$$ /tmp/prev-authors.$$
diff --git a/doc/contribute-to-core-lightning/release-checklist.md b/doc/contribute-to-core-lightning/release-checklist.md
index c1bcaef6..a3222c13 100644
--- a/doc/contribute-to-core-lightning/release-checklist.md
+++ b/doc/contribute-to-core-lightning/release-checklist.md
@@ -36,8 +36,8 @@ Here's a checklist for the release process.
6. Push the tag to trigger the "Release 🚀" CI action, which drafts a new `v<VERSION>rc1` pre-release on GitHub and uploads reproducible builds alongside the `SHA256SUMS-v<VERSION>` file and its signature from the `cln@blockstream.com` key.
7. Verify your local `SHA256SUMS-v<VERSION>` file matches the one in the draft release, then append your local signatures to the release's `SHA256SUMS-v<VERSION>.asc` file to attest to the build's integrity.
8. Announce rc1 release on core-lightning's release-chat channel on Discord & Telegram.
-9. Use `devtools/credit --verbose v<PREVIOUS-VERSION>` to get commits, days and contributors data for release note.
-10. Prepare release notes draft including information from above step, and share with the team for editing.
+9. Use `devtools/credit --markdown v<PREVIOUS-VERSION>` to generate a single contributor list for the release notes. Use `devtools/credit --verbose v<PREVIOUS-VERSION>` for namer selection and detailed annotations.
+10. Prepare release notes draft including the contributor list from above, and share with the team for editing.
11. Upgrade your personal nodes to the rc1, to help testing.
12. Github action `Publish Python 🐍 distributions 📦 to PyPI and TestPyPI` uploads the pyln modules on test PyPI server. Make sure that the action has been triggered with RC tag and that the modules have been published on `https://test.pypi.org/project/pyln-*/#history`.
13. Docker image publishing is handled by the GitHub action `Build and push multi-platform docker images`. Ensure that this action is triggered and that the RC image has been successfully uploaded to Docker Hub after the action completes. Alternatively, you can publish Docker images by running the `tools/build-release.sh docker` script. The GitHub action takes approximately 3-4 hours, while the script takes about 6-7 hours. It is highly recommended to test your Docker setup if you haven't done so before. Prior to building docker images by `tools/build-release.sh` script, ensure that `multiarch/qemu-user-static` setup is working on your system as described [here](https://docs.corelightning.org/docs/docker-images#setting-up-multiarchqemu-user-static).
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.