-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Shadow repo checkpoints #958
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
Conversation
|
src/services/checkpoints/__tests__/ShadowCheckpointService.test.ts
Outdated
Show resolved
Hide resolved
49819e9 to
90b019f
Compare
| .map((line) => line.split(" ")[0].trim()) | ||
| } | ||
| } catch (error) { | ||
| console.warn(`Failed to read .gitattributes: ${error instanceof Error ? error.message : String(error)}`) |
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.
Logging and error handling: Consider using structured logging (or our logging utility) instead of console.warn, to align with our structured logging standards.
| console.warn(`Failed to read .gitattributes: ${error instanceof Error ? error.message : String(error)}`) | |
| this.log(`Failed to read .gitattributes: ${error instanceof Error ? error.message : String(error)}`) |
Description
This is Cline's checkpoints implementation and it uses a clever git feature to create a checkpoint system. It works by:
core.worktreeThe checkpoint mechanism is straightforward:
git add . && git commitin the shadow repository captures the workspace stategit reset --hard <sha>in the shadow repository restores the workspace filesThis approach separates checkpoint history from any existing git repository in the workspace, while still leveraging git's powerful version control capabilities.
Type of change
How Has This Been Tested?
Checklist:
Additional context
Related Issues
Reviewers
Important
Introduces shadow repository checkpoints using Git, with UI updates and tests for managing and displaying checkpoint data.
ShadowCheckpointServiceandLocalCheckpointServicefor managing checkpoints using shadow and local strategies respectively.CheckpointServiceFactoryto create checkpoint services based on strategy.Cline.tsto integrate checkpoint services and handle task directory size.ChatRow.tsx,TaskHeader.tsx, andCheckpointMenu.tsxto display checkpoint information and actions.pretty-bytesfor formatting file sizes in UI.LocalCheckpointServiceandShadowCheckpointServicein their respective test files.HistoryView.test.tsxto test new UI functionalities.package.jsonto includeget-folder-sizeandpretty-bytesdependencies.This description was created by
for 90b019f. It will automatically update as commits are pushed.