[681] Keep the tracked .bot tree out of the shared git exclude - #689
Open
EnmaJim wants to merge 2 commits into
Open
[681] Keep the tracked .bot tree out of the shared git exclude#689EnmaJim wants to merge 2 commits into
EnmaJim wants to merge 2 commits into
Conversation
Ensure-DotbotWorktreeExcludes writes to the common-dir .git/info/exclude, which is shared with the operator main checkout, so the .bot/workspace/tasks, .bot/content, .bot/hooks and .bot/settings entries silently ignored tracked files in the project itself. Drop those entries and scope the worktree-local suppression to a nested .gitignore inside the generated content, hooks and settings copies instead. Complete-TaskWorktree now logs a warning when staging task state fails rather than discarding git output, and doctor reports any workspace tree that is still ignored along with the rule responsible. Refs: andresharpe#681
The WORKSPACE TRACKING section walked the path it was handed, so running doctor from a task worktree inspected that worktree's generated .gitignore files and flagged the tracked .bot tree as hidden. It now maps back to the main repository via git rev-parse --git-common-dir, reporting identically from either checkout, and the E2E worktree test asserts the clean result. Refs: andresharpe#681
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Linked issue
Closes #681
Summary of changes
Ensure-DotbotWorktreeExcludesresolves its target withgit rev-parse --git-path info/exclude, which git answers from the shared common directory — so the marker block written on every task worktree creation also applied to the operator's main checkout. Its entries for.bot/workspace/tasks,.bot/content,.bot/hooksand.bot/settingsignored trees dotbot documents as tracked:git add .bot/workspace/tasks/became a silent no-op, run state accumulated invisibly, andFrameworkIntegrity'sgit statusscan passed over three of its protected paths. This PR takes those entries out of the shared block, suppresses the generated copies from inside the worktree instead, and teachesdotbot doctorto report the condition rather than pass silently..bot/workspace/tasks,.bot/content/,.bot/hooks/and.bot/settings/from the exclude marker block, leaving only generated, never-tracked paths; affected repos self-heal on their next task because the block is rewritten in placecontent/,hooks/andsettings/copies with a nested.gitignorein each, which cannot reach the main checkoutWORKSPACE TRACKINGsection todotbot doctorthat runsgit check-ignore -vover the five tracked trees, names the responsible rule asfile:line:pattern, and resolves back to the main repository viagit rev-parse --git-common-dirso it reports identically from either checkoutgit addinComplete-TaskWorktree: capture its output, check the exit code, and log a warning instead of sending stderr to$nullRestore-DotbotTaskStateBackuppassing-LiteralPathtoNew-Item, which is not a valid parameter and threw as soon as the task tree was visible to git againTest-Components.ps1and record the change inCHANGELOG.mdTesting notes
.git/info/excludewith the legacy block, add a worktree, runEnsure-DotbotWorktreeExcludes, then assertgit check-ignorereports.bot/workspace/tasksand.bot/contentunignored while generated.mcp.jsonstays ignoredgit add .bot/workspace/tasks/(no-f) stages a new run file, matching howComplete-TaskWorktreestages statedoctor.ps1against a live task worktree's.botand assert it does not flag the worktree's own generated.gitignorefiles.bot/tracked-tree entry returns to the exclude block.git/info/excludeno longer contains.bot/workspace/tasks/, andgit status -- .bot/workspace/tasksshows the accumulated run directories instead of reporting cleanChecklist