pub-release: changelog unfolds merges of our own branches

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
tthandClaude Opus 5.5 committed 2026-11-12 17:47:25 +01:00
1 parent d4afea1eb3
commit a2dacb805d
1 file changed
+14 -3
+14 -3
View File
@@ -203,9 +203,20 @@ jobs:
| sort_by(.created_at) | reverse | .[] | "\(.tag_name) \(.target_commitish)"')
# no older release: the last 20 commits of our own line
[ -n "$base" ] || base=$(git rev-list --first-parent --max-count=21 "$SHA" | tail -1)
# ours: commits on our main itself (first parent), not what the
# upstream merges brought in
ours=$(git log --first-parent --no-merges --format="- %s ([%h]($web/commit/%H))" "$base..$SHA")
# ours: commits on our main itself (first parent); a merge of one of
# our own branches (feat/...) is unfolded into the branch's commits,
# an upstream merge is left to the upstream list below
fmt="- %s ([%h]($web/commit/%H))"
ours=""
for c in $(git log --first-parent --format=%H "$base..$SHA"); do
if git rev-parse -q --verify "$c^2" >/dev/null; then
git log -1 --format=%s "$c" | grep -q '^Merge upstream' && continue
ours+=$(git log --no-merges --format="$fmt" "$c^1..$c^2")$'\n'
else
ours+=$(git log -1 --format="$fmt" "$c")$'\n'
fi
done
ours=${ours%$'\n'}
# upstream: the first-parent line of each merged upstream branch,
# PR merges as their title, direct commits as their subject
declare -A seen=()