Repository navigation
refactor: sweep dead code, route git spawns through the port, unify cached shells - #202
Merged
Merged
Conversation
…ached shells
Plan 029. No behavior change.
- Delete production-dead symbols: syncPlan (superseded by
SyncPlanAgainst), popUndo (PeekUndo+DropUndo inline), PushRemote
(superseded by PushBranches), DiffCachedPatch (superseded by
DiffCachedPatchFor). Tests ported to the successor APIs.
- cmd/worktree_copy.go: move the two direct git spawns behind the port
— new git.LsFilesZ (NUL-parsed ls-files) and git.CheckIgnored
(batched check-ignore with per-entry fallback, same semantics).
Production cmd/ now contains zero exec.Command("git") calls.
- cmd/gitenv.go: collapse cachedShell/cachedQuietShell twins into a
single cachedPort decorator wrapping any stack.Git; the JSON-mode
swap now constructs cachedPort{git.QuietShell} instead of a
fail-open type assertion.
- Smalls: drop untrack's one-off fs.Usage override, hasSuffix ->
strings.HasSuffix, joinNames/joinComma -> strings.Join, refresh
stale engine.go line cites in e2e crash tests, and bundle the
8-param log render context into logData.
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.
Plan 029 — Tech-debt sweep
Verified each "dead" symbol against HEAD before deleting; all four were
unreferenced outside tests.
syncPlan(thin wrapper overSyncPlanAgainst— tests ported to call it directly),popUndo(test ported to
PeekUndo+DropUndo),PushRemote(tests ported toPushBranches),DiffCachedPatch(tests ported toDiffCachedHunks+DiffCachedPatchFor).cmd/worktree_copy.gono longer spawns gitdirectly — new port funcs
git.LsFilesZandgit.CheckIgnoredcarrythe identical batch-then-per-entry-fallback contract.
grep 'exec.Command("git"' cmd/outside tests: zero hits.cachedPortdecorator embeds anystack.Git;stackEnvconstructscachedPort{git.QuietShell{}}inJSON mode instead of type-asserting (the old swap failed open if
gitShell's type changed).untrack's divergentfs.Usageremoved;hasSuffix/joinNames/joinCommareplaced bystringsstdlib; staleengine.go:<lines>cites in e2e crash tests refreshed; the 8-paramprintLogJSON/printLogTreecontext bundled intologData.File splits (
git.go/engine.go/*_test.gosizes) intentionally skippedper plan — churn without behavior value.
Verification
make test-fastgreengo test ./cmd -run 'Worktree|Include|JSONStackEnv|RenameInvalidates|Untrack|DetectShell'greengo test ./internal/gitgreenmake cigreen — merged coverage 87.5%plans/content on this branch.