Skip to content

Commit d46d229

Browse files
committed
contrib: Introuce gen_news
Leveraging the git trailers, we have now a tool that builds the content of the NEWS file directly from the git history.
1 parent 27b3b80 commit d46d229

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

contrib/gen-news

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/bin/env sh
2+
# Copyright (C) 2025 Yubico AB - See COPYING
3+
#
4+
# Generate content for the NEWS file from git history.
5+
#
6+
# Commits that are relevant for the NEWS file should be marked by
7+
# means of their "Changelog" trailer (see git-interpret-trailers).
8+
#
9+
# A list of allowed values is available in contrib/allowed-trailers.txt
10+
11+
set -eu
12+
13+
if [ -n "${1-}" ]; then
14+
range="$1"
15+
git rev-list --quiet "$range" --
16+
else
17+
range="$(git describe --abbrev=0 --match 'pam_u2f-*')..HEAD"
18+
fi
19+
20+
git log \
21+
--oneline \
22+
--pretty="%(trailers:key=Changelog,valueonly,separator=%x2C): %s" \
23+
"$range" |
24+
sed -n '/^\w\+:/s/^/** /p'

0 commit comments

Comments
 (0)