Repository navigation
Add batched commit summaries for history lists - #81
Merged
Merged
Conversation
This was referenced Nov 21, 2026
Mistium
force-pushed
the
commit-summaries
branch
from
November 21, 2026 01:58
e5896b7 to
b961684
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follows #80 (merged).
Most MistWarp commits keep the default message "Updated project", so a project's history list is a wall of identical rows. This adds a batched endpoint that the history list can use to describe each commit instead.
What it adds
GET /v1/projects/:id/commit-summaries?shas=<sha>,<sha>returns one short summary per commit:{"ok": true, "summaries": {"<sha>": { "ok": true, "sha": "<sha>", "initial": false, "legacy": false, "totals": {"scripts": {"added": 1, "removed": 0, "changed": 2, "moved": 0}, "items": 0, "state": 3, "assets": {"added": 0, "removed": 0, "modified": 1}, "files": 0, "stateOnly": false}, "sprites": ["Main", "Window"], "spriteCount": 2, "authoredFiles": 0, "tooLarge": false }}}totalsis exactly what/commits/:sha/changesreports (a Go test checks they match).spritesnames up to five sprite folders that had script, item or asset changes. Saved state alone,fonts/and rootassets/files are counted in the totals but name no sprite./commits/:sha/changes(canSeeInsideProject,projectRecordsCommit). Smoke steps check that a private project gives 404 signed out and as a stranger, and 200 as an editor.Why it's computed when read, not at save time
The plan said to store summaries at save time.
gitCommitsis rebuilt in many save paths, and only its last 50 entries are kept. Computing on read covers every existing commit straight away, including history from before this change, and needs no migration.Caching
A commit's summary depends only on its content, so it is cached by project and SHA rather than by workspace fingerprint. That means saving the project doesn't throw the summaries away.
tmp/git-summaries/, kept out of the 256-filegit-inspection/directory so it can't push the workspace caches out. The cache name carries its own version (s1).Locally, all 100 most recent commits of a real public project (
p1790295130360345000J3JZRS) summarise in about 5 seconds cold. After that they are served from the cache.Other changes
changesBetweenis split intocomputeChangesplus the existing encoder, so the summary and changes views share one code path./changesoutput is unchanged (the totals parity test covers it).src/git/commit-summary-cache.oslholds the pure helpers (SHA parsing, cache entry rules, merge cap), with OSL tests.Checks
go test ./...andgo vetinnative/gitinspection, with new tests for:osl test: 63 passed.osl compile main.oslwith the CI pin.python3 scripts/check_conventions.py.python3 scripts/e2e_smoke.py: 340 steps, 0 unexpected server errors, with new steps for:scripts/route_dump.pyonly gainsGET /v1/projects/:id/commit-summaries.Version: 1.2.0 (from #80) → 1.3.0, a new backwards-compatible endpoint.
No visible surface in this PR. The history list that uses it is MistWarp/scratch-gui (linked from there), and the docs are in MistWarp/docs.