Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

Release notes show each change's headline alone (#9496)

Garry Tan98b5a398e1f2
diff --git a/changelog.d/capy-release-notes-headline-cut.md b/changelog.d/capy-release-notes-headline-cut.md
new file mode 100644
index 0000000000..32e6263843
--- /dev/null
+++ b/changelog.d/capy-release-notes-headline-cut.md
@@ -0,0 +1,7 @@
+**A release's list of changes shows each change's headline alone, even when its changelog entry continues on the headline's line.**
+
+### Fixed
+- `scripts/changelog-entry.sh --pr-list` cuts each fragment's first bold line at its closing `**`. Before, a fragment whose body text followed the headline on the same line put that whole paragraph, with a stray `**`, into the release notes.
+
+### For contributors
+- `test/release-workflow.test.ts` covers a fragment with body text after its headline.
diff --git a/scripts/changelog-entry.sh b/scripts/changelog-entry.sh
index 2b70e5f80c..40fa2cf604 100755
--- a/scripts/changelog-entry.sh
+++ b/scripts/changelog-entry.sh
@@ -7,7 +7,8 @@
# With --pr-list, run in a git checkout of the release commit, the body opens
# with one line per change: for every changelog.d fragment a release commit
# deleted since the newest v* tag before HEAD, in fold order (oldest release
-# first, then path order), the fragment's first bold line plus the "(#N)" of
+# first, then path order), the fragment's first bold line, cut at its closing
+# "**", plus the "(#N)" of
# the master commit that added it; a trailing internal issue code such as
# "(GST-123)" is dropped from the line. The list goes on the GitHub release only;
# CHANGELOG.md never carries it.
@@ -44,7 +45,7 @@ list_changes() {
headline="$(git show "$release^:$path" | awk '
NR == 1 && /^---[[:space:]]*$/ { fm = 1; next }
fm { if (/^---[[:space:]]*$/) fm = 0; next }
- /^\*\*/ { sub(/^\*\*/, ""); sub(/\*\*[[:space:]]*$/, ""); print; exit }
+ /^\*\*/ { s = substr($0, 3); i = index(s, "**"); if (i) s = substr(s, 1, i - 1); print s; exit }
')"
[ -n "$headline" ] || continue
subject="$(git log --first-parent --diff-filter=A --format=%s -1 "$release^" -- "$path")"
diff --git a/test/release-workflow.test.ts b/test/release-workflow.test.ts
index 2fd23ebed5..1fbe547c52 100644
--- a/test/release-workflow.test.ts
+++ b/test/release-workflow.test.ts
@@ -264,6 +264,17 @@ describe('scripts/changelog-entry.sh --pr-list', () => {
}
});
+ test('a headline with body text after its closing ** on the same line prints the headline alone', () => {
+ const repo = fixture();
+ try {
+ commit(repo, 'Purged pages stay purged (#31)', { 'changelog.d/h-theta.md': '---\nimportant: security\n---\n**A purged page stays purged after a restore.** When an owner purges a page, more text follows **here**.\n' });
+ commit(repo, 'v0.1.1.0 release (#32)', { VERSION: '0.1.1.0\n', 'CHANGELOG.md': section('0.1.1.0', 'Folded.'), 'changelog.d/a-alpha.md': null, 'changelog.d/b-beta.md': null, 'changelog.d/h-theta.md': null });
+ expect(run(repo, '--pr-list', '0.1.1.0')).toBe('- Search finds old pages again (#12)\n- Sync is faster (#11)\n- A purged page stays purged after a restore (#31)\n\n\nFolded.\n');
+ } finally {
+ rmSync(repo, { recursive: true, force: true });
+ }
+ });
+
test('with no earlier release tag the body is the plain entry', () => {
const repo = fixture();
try {