-
Notifications
You must be signed in to change notification settings - Fork 2.6k
refactor:improve checkpoint and ensure gc to improve disk space #3695
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
refactor:improve checkpoint and ensure gc to improve disk space #3695
Conversation
|
|
@gauravsaini would you be able to convert the PR to draft and generate and link to an issue please? |
e72e069 to
43387b1
Compare
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
|
@hannesrudolph |
|
@cte would you be able to review this before it gets outdated? Looks promising. |
|
Hey @gauravsaini, thank you for your contribution, I really like your implementation. Since they don't add useful information to the code itself. |
| // Copied | ||
| filesToAdd.push(filePath) // Add the new path | ||
| } | ||
| // Other statuses like 'U' (unmerged) might need specific handling if relevant |
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.
Hey @gauravsaini, quick thought on the new stageAll logic: how does it handle files that were part of a merge conflict and have been resolved in the working directory but not yet git added? The if/else chain doesn't seem to explicitly cover 'U' (unmerged) statuses. Just wondering if this might mean resolved conflicts aren't always included in checkpoints?
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.
This seems like a non-issue, checkpoints won't have to deal with merge conflicts and much less with files that had merge conflicts at some point and then got the conflict solved.
|
Hey @gauravsaini, it seems like the flag await git.raw(["repack", "-a", "-d", "-f", "--path-walk", "--quiet"])Isn't available on my git version Do I need an specific version for this to work? |
|
After looking ways to reduce checkpoints, I stumbled upon this PR. It looks like Since this option really shines for large scale repositories, maybe we could omit this for compatibility (I'm on a Mac), or use a similar but less efficient option like ref: https://www.jonathancreamer.com/how-we-shrunk-our-git-repo-size-by-94-percent/ |
Hey @ijin, it seems like the author of the PR is unavailable, if you'd like you can create a PR based on this one with the compatibility changes, let's see how that turns out. Let me know if you have any questions! |
@daniel-lxs I took a stab at it! |
…rtcuts in Cline (RooCodeInc#3695) * Fix: Temporary revert protobus changes for Toggle plan and act mode * Adding telemetry * Adding telemetry * Adding telemetry * Adding telemetry * Adding telemetry --------- Co-authored-by: Cline Evaluation <[email protected]>
|
closed in favour of #4494 |
Related GitHub Issue
Closes #3391
Closes #3348
Closes #3080
Description
Garbage collection and perf improvements
Upgrade to git 2.49.0 for additional benefits
Test Procedure
Unit tests added
Sanity test on local
Type of Change
srcor test files.Pre-Submission Checklist
npm run lint).console.log) has been removed.npm test).mainbranch.npm run changesetif this PR includes user-facing changes or dependency updates.Screenshots / Videos
Documentation Updates
Additional Notes
Important
Refactor
ShadowCheckpointServiceto improve performance and disk space management by caching nested git paths, optimizing file staging, and introducing garbage collection.ShadowCheckpointServiceto avoid repeated scans.stageAll()to usegit statusfor specific file changes instead ofgit add ..renameNestedGitRepos()to use cached paths.git repackduring initialization if a shadow repo exists.git gcafter every 20 checkpoints insaveCheckpoint().git gc --prune=nowafter deleting a branch indeleteBranch().getDiff()to usegit diff --name-statusfor precise change tracking and handle file content retrieval more accurately.This description was created by
for e72e069fa7d9ddc64f3c1de60f579450e136bec9. You can customize this summary. It will automatically update as commits are pushed.