Skip to content

Conversation

@0xMink
Copy link
Contributor

@0xMink 0xMink commented Feb 10, 2026

Closes #10636
Closes #11340

Summary

  • Replace the checkpoint "kill switch" for nested git repos with a detect-and-exclude approach
  • Detect nested repos via .git/HEAD and .git pointer files (dual ripgrep scan, no --follow)
  • Exclude nested repo paths via .git/info/exclude (anchored patterns) and staging pathspec excludes
  • Post-staging enforcement: purge mode-160000 gitlinks with triggered re-detection; conservative filesystem-based fallback when detection fails
  • Show warning instead of throwing — checkpoints remain functional for all non-nested workspace files
  • Add i18n key nested_git_repos_excluded across all 18 locales (localized translations)

Scope note: This PR intentionally does not change core.worktree comparison canonicalization. That concern is addressed separately in #11346 (worktree path normalization for Windows). The two PRs are orthogonal — merge order is flexible and there are no code conflicts between them.

Test plan

  • Existing: all prior checkpoint tests continue to pass
  • New: nested repo files excluded from checkpoints
  • New: submodule .git pointer files detected
  • New: multiple nested repos all detected and excluded
  • New: no gitlink entries (mode 160000) remain after staging
  • New: restore does not touch nested repo directory
  • New: detection failure triggers conservative fallback that aborts on nested content
  • New: real git add failures (not ignored-paths warnings) propagate correctly
  • 37 tests passing

@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. bug Something isn't working labels Feb 10, 2026
@roomote
Copy link
Contributor

roomote bot commented Feb 10, 2026

Rooviewer Clock   See task

Re-reviewed since d4b7e1c. The previously flagged unused import has been removed, and no new issues found. The detect-and-exclude approach with defense-in-depth layering (exclude file, pathspec excludes, gitlink purge, conservative filesystem fallback) looks solid.

  • Unused import arePathsEqual in ShadowCheckpointService.ts (resolved)
Previous reviews

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

Comment on lines 11 to 12
import { fileExistsAtPath } from "../../utils/fs"
import { arePathsEqual } from "../../utils/path"
import { executeRipgrep } from "../../services/search/file-search"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

arePathsEqual is imported here but never used anywhere in the file. This is dead code introduced by this PR.

Suggested change
import { fileExistsAtPath } from "../../utils/fs"
import { arePathsEqual } from "../../utils/path"
import { executeRipgrep } from "../../services/search/file-search"
import { fileExistsAtPath } from "../../utils/fs"
import { executeRipgrep } from "../../services/search/file-search"

Fix it with Roo Code or mention @roomote and request a fix.

…points

Replace the kill switch that disabled checkpoints entirely when nested
git repositories were detected. Instead, detect nested repos at init
time (via ripgrep dual scan for .git/HEAD and .git pointer files),
exclude them from shadow git tracking, and warn the user.

Safety enforcement is defense-in-depth:
- Anchored exclude patterns in .git/info/exclude
- Pathspec excludes in git add
- Post-staging gitlink purge with triggered re-detection
- Conservative filesystem-based fallback when detection fails
- Filtered git add error handling (only suppresses "ignored paths")
@0xMink 0xMink force-pushed the fix/checkpoint-allow-nested-repos branch from 51d2e3c to d4b7e1c Compare February 10, 2026 02:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

1 participant