fix(make): harden reset against dirty submodule locks - #2252
Conversation
make reset failed when skills-lock.json was dirty in dotagents. Hard-reset submodules before force-updating, and bump to the skills-install fix. Co-authored-by: Cursor <cursoragent@cursor.com>
|
|
Warning Review limit reached
Next review available in: 12 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| @echo "🔄 Resetting git status to clean..." | ||
| @git checkout -- . | ||
| @git reset --hard HEAD | ||
| @git submodule foreach --recursive 'git reset --hard HEAD && git clean -fd' |
There was a problem hiding this comment.
Nit — asymmetric cleanup: The submodule foreach step cleans untracked files inside each submodule with git clean -fd, but there's no equivalent git clean -fd at the parent. git reset --hard HEAD on line 290 only touches tracked/staged files, so someone running make reset expecting a clean tree will still see untracked files at the top level while submodules are pristine. If preserving parent untracked files is intentional (safety net), ignore; otherwise consider adding @git clean -fd here for symmetry.
| @echo "🔄 Resetting git status to clean..." | ||
| @git checkout -- . | ||
| @git reset --hard HEAD | ||
| @git submodule foreach --recursive 'git reset --hard HEAD && git clean -fd' |
There was a problem hiding this comment.
Nit — ignored files retained: git clean -fd does not remove .gitignored files inside submodules. If the intent of make reset is to produce a fully pristine tree (e.g., wipe generated caches/artifacts), use git clean -fdx. If retaining caches is intentional, this is fine as-is.
Summary
make resethard-reset and force-update submodules so a dirtyskills-lock.jsoncannot block checkoutdotagentsto include fix(skills): stop rewriting lock on every install dotagents#183 (stop rewriting the lock on everyskills-install)Test plan
dotagents/skills-lock.json,make resetsucceeds and leaves a clean treemake git-submodule-syncstill updates submodules normallymake syncno longer dirtiesdotagentswhen all skills are already installedMade with Cursor
Summary by cubic
Hardened
make resetso dirty submodule locks (e.g.,dotagents/skills-lock.json) no longer block checkout and the tree ends clean. Also made submodule sync recursive and updateddotagentsto stop unnecessary lock rewrites.Bug Fixes
make resetnow hard-resets repo and submodules, cleans submodules, syncs URLs recursively, then force-updates.git-submodule-syncnow usesgit submodule sync --recursive.Dependencies
dotagentsto include theskills-installfix that avoids rewritingskills-lock.jsonwhen unchanged.Written for commit a7dea1f. Summary will update on new commits.