GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: group changelog bugfixes (#25597) · cavanaug/opencode@0a7d02c

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • .opencode/command
    • changelog.md
  • script
    • raw-changelog.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎.opencode/command/changelog.md‎

Copy file name to clipboardExpand all lines: .opencode/command/changelog.md
+4-1Lines changed: 4 additions & 1 deletion
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,12 @@ Do not use `git log` or author metadata when deciding attribution.
1818

1919
Rules:
2020

21-
- Write the final file with sections in this order:
21+
- Write the final file with release sections in this order:
2222
`## Core`, `## TUI`, `## Desktop`, `## SDK`, `## Extensions`
2323
- Only include sections that have at least one notable entry
24+
- Within each release section, keep bug fixes grouped under `### Bugfixes`
25+
- Keep other notable entries under `### Improvements` when a section has bug fixes too
26+
- Omit empty subsections
2427
- Keep one bullet per commit you keep
2528
- Skip commits that are entirely internal, CI, tests, refactors, or otherwise not user-facing
2629
- Start each bullet with a capital letter
Collapse file

‎script/raw-changelog.ts‎

Copy file name to clipboardExpand all lines: script/raw-changelog.ts
+32-8Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,11 @@ function section(areas: Set<string>) {
8282
return "Core"
8383
}
8484

85+
function type(message: string) {
86+
if (message.match(/fix/i)) return "Bugfixes"
87+
return "Improvements"
88+
}
89+
8590
function reverted(commits: Commit[]) {
8691
const seen = new Map<string, Commit>()
8792

@@ -193,13 +198,20 @@ async function thanks(from: string, to: string, reuse: boolean) {
193198
}
194199

195200
function format(from: string, to: string, list: Commit[], thanks: string[]) {
196-
const grouped = new Map<string, string[]>()
197-
for (const title of order) grouped.set(title, [])
201+
const grouped = new Map<string, Map<string, string[]>>()
202+
for (const title of order) {
203+
grouped.set(
204+
title,
205+
new Map([
206+
["Improvements", []],
207+
["Bugfixes", []],
208+
]),
209+
)
210+
}
198211

199212
for (const commit of list) {
200-
const title = section(commit.areas)
201213
const attr = commit.author && !team.includes(commit.author) ? ` (@${commit.author})` : ""
202-
grouped.get(title)!.push(`- \`${commit.hash}\` ${commit.message}${attr}`)
214+
grouped.get(section(commit.areas))!.get(type(commit.message))!.push(`- \`${commit.hash}\` ${commit.message}${attr}`)
203215
}
204216

205217
const lines = [`Last release: ${ref(from)}`, `Target ref: ${to}`, ""]
@@ -209,11 +221,23 @@ function format(from: string, to: string, list: Commit[], thanks: string[]) {
209221
}
210222

211223
for (const title of order) {
212-
const entries = grouped.get(title)
213-
if (!entries || entries.length === 0) continue
224+
const groups = grouped.get(title)
225+
if (!groups || [...groups.values()].every((entries) => entries.length === 0)) continue
214226
lines.push(`## ${title}`)
215-
lines.push(...entries)
216-
lines.push("")
227+
const improvements = groups.get("Improvements")!
228+
const bugfixes = groups.get("Bugfixes")!
229+
if (bugfixes.length === 0) {
230+
lines.push(...improvements)
231+
lines.push("")
232+
continue
233+
}
234+
235+
for (const [subtitle, entries] of groups) {
236+
if (entries.length === 0) continue
237+
lines.push(`### ${subtitle}`)
238+
lines.push(...entries)
239+
lines.push("")
240+
}
217241
}
218242

219243
if (thanks.length > 0) {

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.