-
Notifications
You must be signed in to change notification settings - Fork 519
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Checkpoint service #626
Checkpoint service #626
Conversation
|
54c28a9
to
2eb3637
Compare
6cac8ce
to
21724e2
Compare
* Saving a checkpoint: | ||
* - Current changes are stashed (including untracked files). | ||
* - The hidden branch is reset to match main. | ||
* - Stashed changes are applied and committed as a checkpoint on the hidden | ||
* branch. | ||
* - We return to the main branch with the original state restored. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this cause any kind of visible flicker or file change event to be emitted? Just wondering about any potential impact on things that watch for file changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question; we should check for this while we dogfood the feature.
Description
Currently Cline has a nice "checkpoints" feature (see demo) that allows you to revert your VSCode workspace to a point in time in the chat history. It does this by creating a "shadow" repository that is completely isolated from the current repo (if any).
An alternative approach that I'm exploring here is to use a separate branch to more space efficiently store checkpoints that can be restored using
git restore
.I consulted o1 Pro about the differences between these approaches, and here's what it thinks:
Type of change
How Has This Been Tested?
Checklist:
Additional context
Related Issues
Reviewers
Important
Introduces
CheckpointService
to manage VSCode workspace checkpoints using Git, with comprehensive tests for various scenarios.CheckpointService
inCheckpointService.ts
to manage VSCode workspace checkpoints using Git.git restore
.saveCheckpoint()
stashes changes, resets hidden branch, applies stash, and commits.restoreCheckpoint()
restores workspace to a specified checkpoint.CheckpointService.test.ts
for creating, restoring, and handling edge cases like untracked files and branch mismatches.This description was created by
for 2bff829. It will automatically update as commits are pushed.