Document large workspace Git audits#277
Conversation
ariobarin
left a comment
There was a problem hiding this comment.
Current-head review at d693389de504ead64357b50dee51bbdfb65670b9: no blocking findings. The new workspace-audit reference is read-only, preserves cleanup authority boundaries, handles linked worktrees explicitly, and gives scalable evidence collection guidance. portable checks run 1054 completed successfully, with no existing review comments or unresolved threads. Ready for merge under the user's explicit authority.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d693389de5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| ```powershell | ||
| git -C <candidate> rev-parse --show-toplevel | ||
| git -C <candidate> rev-parse --git-common-dir |
There was a problem hiding this comment.
Canonicalize common dirs before deduping
When the search discovers both the canonical checkout and a linked worktree for the same repository, this command can return .git for the main worktree while the linked worktree returns an absolute common-dir path; Git's rev-parse docs say --path-format=absolute makes affected paths absolute and canonical. A script following this block and deduplicating these returned strings will count one repository twice and rerun worktree list, defeating the scalable inventory the reference is meant to provide; please make the common-dir output absolute or explicitly canonicalize it before the line-26 dedupe.
Useful? React with 👍 / 👎.
| Collect worktree state with bounded parallelism: | ||
|
|
||
| ```powershell | ||
| git -C <worktree> status --porcelain=v2 --branch |
There was a problem hiding this comment.
Keep status probes from writing index metadata
For audits run against read-only mounts or users' active worktrees, this plain git status is not actually read-only: I verified the exact command updates .git/index mtime, and Git's top-level docs provide --no-optional-locks for operations that would require optional locks. Since the reference promises a read-only preservation inventory, use git --no-optional-locks -C <worktree> status ... or set GIT_OPTIONAL_LOCKS=0 for the audit so the inventory does not mutate every worktree it inspects.
Useful? React with 👍 / 👎.
Large nested workspaces need a scalable read-only inventory that preserves linked worktrees without recursive
.gitstatus scans. This adds a focused reference and keeps cleanup behind separate authority.