Fix gt-pvx auto-save committing deletions of tracked files#3620
Open
justinstimatze wants to merge 1 commit intogastownhall:mainfrom
Open
Fix gt-pvx auto-save committing deletions of tracked files#3620justinstimatze wants to merge 1 commit intogastownhall:mainfrom
justinstimatze wants to merge 1 commit intogastownhall:mainfrom
Conversation
Both auto-save mechanisms (gt done safety net and checkpoint_dog) use git add -A which stages deletions. A polecat whose working tree has a missing tracked file (e.g. .beads/metadata.json) gets that deletion auto-committed, breaking infrastructure for subsequent sessions. Fix: after git add -A, query staged deletions via git diff --cached --name-only --diff-filter=D and unstage them. A safety-net commit should preserve work (additions + modifications), never destroy it (deletions). Also adds runtime dir exclusions to done.go (.beads/, .claude/, .runtime/, __pycache__/) matching checkpoint_dog's existing runtimeExcludeDirs. Fixes gastownhall#3615
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.
Summary
gt donesafety net andcheckpoint_dog) usegit add -Awhich stages deletions of tracked files.beads/metadata.json) gets that deletion auto-committed, breaking infrastructure for subsequent sessionsgit add -A, unstage all staged deletions viagit diff --cached --name-only --diff-filter=Ddone.go(.beads/,.claude/,.runtime/,__pycache__/) matchingcheckpoint_dog's existingruntimeExcludeDirsFixes #3615
Changes
internal/git/git.go— newStagedDeletions()methodinternal/cmd/done.go— add runtime dir exclusions + deletion unstaginginternal/daemon/checkpoint_dog.go— add deletion unstaging after existing runtime dir exclusionsDesign rationale
A safety-net auto-commit should preserve work (additions + modifications), never destroy it (deletions). Renames are unaffected — git detects them as
Rstatus, notD, even with content changes down to 75% similarity.Test plan
go build ./...passesgo test ./internal/git/...passesgo test ./internal/daemon/...passes--diff-filter=D(tested at 100% and 75% similarity)go test ./internal/cmd/...has pre-existing compile error incompact_report_test.go(unrelated)