Skip to content

Add last-commits inspection for per-path latest changes - #82

Merged
Mistium merged 2 commits into
mainfrom
last-commits
Nov 21, 2026
Merged

Mistium merged 2 commits into
mainfrom
last-commits

Conversation

@Mistium

@Mistium Mistium commented Nov 21, 2026

Copy link
Copy Markdown
Member

Adds GET /v1/projects/:id/commits/:sha/last-commits, which returns the latest commit that changed each file and folder in a commit's tree. The new developer view on project pages uses it to show the GitHub-style "latest commit" column.

How it works:

  • A new last-commits operation in native/gitinspection walks first-parent history from the commit. It compares each commit's tree with its parent's and only goes into subtrees whose hashes changed.
  • A .fractch file only counts as changed when its scripts or declarations change. Every save rewrites saved variable values and positions in every sprite file, so without this filter almost every folder showed the newest commit. With it, the results match the commit summaries. On a real 50-commit project the walk takes about 130 ms, and the result goes through the existing per-head disk cache.
  • A folder counts as changed when something inside it changes, or when a child is added or removed.
  • The walk stops at 2000 commits or a 64 MB fractch parse budget. When it stops early it reports complete: false and leaves the remaining paths out, rather than guessing.
  • The route uses gitInspectionResponse, so it has the same access checks as /tree: see-inside, pull-commit access and recorded commits. The response carries author name, date and message only.
  • Students can call it, like /tree.

Response shape: {ok, sha, paths: {path: sha}, commits: {sha: {author, date, message}}, complete}.

Version: 1.3.0 to 1.4.0 (new endpoint).

Checks:

  • go test ./... in native/gitinspection passes, with new tests for:
    • newest authored change per path;
    • commits that only change saved state;
    • message-only commits;
    • added folders;
    • the walk limit;
    • running out of parse budget.
  • osl test passes: 63 tests.
  • osl lsp check main.osl reports warnings only, and they were already there.
  • osl compile and scripts/e2e_smoke.py pass.

No visible surface, so no screenshots here. The UI is in the scratch-gui developer view PR.

@Mistium
Mistium merged commit ade78d7 into main Nov 21, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant