mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-11-29 02:17:48 +08:00
* feat(tui): add last-commit diff view option
Adds a new diff source to the TUI diff viewer that shows only the
changes introduced by the most recent git commit (HEAD vs HEAD~1),
independent of working tree state.
- Extend Vcs.Mode with "last-commit" and implement lastCommitDiff
using new Git helpers (diffRefs, statsRefs, patchAllRefs) that
compare two arbitrary refs. Build a batched patch from HEAD~1..HEAD
so each file gets the correct ref-to-ref patch instead of falling
through to the patchUntracked path.
- Regenerate SDK and OpenAPI spec for the new mode.
- Expose the option in the diff viewer's Switch source dialog.
* fix(cli): recover last-commit diffs when batch fetch is truncated
When a single oversized file in a commit pushed the unified batch
patch over MAX_TOTAL_PATCH_BYTES, lastCommitDiff discarded the
batched patches of every smaller file and returned empty stubs. It
also silently dropped any chunk whose filename could not be parsed
back from the patch header.
Route the lastCommitDiff loop through the existing patchForItem +
totalPatch helpers used by diffAgainstRef: files present in the
batch map use the batched patch, files missing from it (truncated
tail or failed filename match) fall back to a per-file
`git diff <parent>..HEAD -- <file>` call, and the running byte
total still caps the overall output so behavior matches diff('branch').