Skip to content

Commit cfee2d2

Browse files
committed
docs(release): put the commit-log JSDoc back on parseCommitLog
1 parent b1d900c commit cfee2d2

1 file changed

Lines changed: 11 additions & 7 deletions

File tree

‎scripts/release-notes.ts‎

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -332,13 +332,9 @@ export function extractCommitBulletSections(body: string): string {
332332
}
333333

334334
/**
335-
* Parse `git log -z --format=%H%x00%s%x00%an` output into commits.
336-
*
337-
* Records are NUL-delimited and fields are NUL-separated. Git forbids NUL in
338-
* commit content, so — unlike the unit separator, which Git happily accepts in
339-
* both subjects and author names — no field value can forge a boundary. Every
340-
* record is read as exactly three fields; anything longer is a malformed record
341-
* and is skipped rather than silently reinterpreted.
335+
* Merge several already-rendered commit-bullet bodies into one set of category
336+
* sections, preserving order within a category and de-duplicating identical
337+
* bullets. Concatenating the bodies directly would repeat a shared heading.
342338
*/
343339
export function mergeCommitBulletSections(bodies: string[]): string {
344340
const buckets = new Map<string, string[]>();
@@ -376,6 +372,14 @@ export function mergeCommitBulletSections(bodies: string[]): string {
376372
return merged.join("\n\n").trim();
377373
}
378374

375+
/**
376+
* Parse `git log -z --format=%H%x00%s%x00%an` output into commits.
377+
*
378+
* Records and fields are NUL-separated. Git forbids NUL in commit content, so
379+
* — unlike the unit separator, which Git accepts in both subjects and author
380+
* names — no field value can forge a boundary. Every record is read as exactly
381+
* three fields.
382+
*/
379383
export function parseCommitLog(raw: string): ReleaseNoteCommit[] {
380384
const commits: ReleaseNoteCommit[] = [];
381385
const fields = raw.split("\u0000");

0 commit comments

Comments
 (0)