b33a68e0dd08

show full version-range changelog on nina update instead of only the latest release's notes

time
2026-07-01 22:08 UTC · 3 months ago
machine
koh2
agent
claude-sonnet-5
session
changelog range and clean nix update output
parent
d51758b58acb
2 files VERSION+1 −1src/commands.zig+14 −4
VERSION+1 −1
@@ -1 +1 @@1-3.4.6\ No newline at end of file1+3.4.7

view file

src/commands.zig+14 −4
@@ -441,9 +441,13 @@441441         };442442         defer ctx.gpa.free(r.stdout);443443         defer ctx.gpa.free(r.stderr);444-        output.raw(r.stdout);445-        output.raw(r.stderr);444+        // nix's own progress lines (unpacking archives, derivation hashes, store445+        // paths) are internal build machinery, not something a user needs to see446+        // on a normal upgrade — they read like something broke. Only surface them447+        // when the upgrade actually failed, so there's something to diagnose from.446448         if (r.exit_code != 0 or nixUpgradeNoOp(r.stdout) or nixUpgradeNoOp(r.stderr)) {449+            output.raw(r.stdout);450+            output.raw(r.stderr);447451             output.updateSelfNixFailed();448452             return;449453         }@@ -519,12 +523,18 @@519523     output.updateSelfDone(version.VERSION, remote_ver);520524 }521525 526+// archives.json covers every version between current and latest; the manifest's527+// `notes` field only ever describes the single latest release. Try the full-range528+// changelog first so an update spanning several versions doesn't collapse down to529+// just the newest one's notes — fall back to `notes` only when the archive has530+// nothing (e.g. releases predating archives.json, or the fetch failing).522531 fn updateReleaseNotes(gpa: std.mem.Allocator, io: std.Io, root: std.json.Value, source_url: []const u8, current: []const u8, latest: []const u8) ![]u8 {523-    if (releaseNotesFromMetadata(gpa, root)) |notes| {532+    if (buildKeprArchiveReleaseNotes(gpa, io, source_url, current, latest) catch null) |notes| {524533         if (std.mem.trim(u8, notes, " \t\r\n").len > 0) return notes;525534         gpa.free(notes);526535     }527-    return buildKeprArchiveReleaseNotes(gpa, io, source_url, current, latest) catch gpa.dupe(u8, "");536+    if (releaseNotesFromMetadata(gpa, root)) |notes| return notes;537+    return gpa.dupe(u8, "");528538 }529539 530540 fn releaseNotesFromMetadata(gpa: std.mem.Allocator, root: std.json.Value) ?[]u8 {

view file