Repository navigation
fix(pstack): preserve worktree paths containing spaces - #660
Open
rudycelekli wants to merge 1 commit into
Open
rudycelekli wants to merge 1 commit into
rudycelekli wants to merge 1 commit into
Conversation
Signed-off-by: Rudy Celekli <rudycelekli@users.noreply.github.com>
rudycelekli
force-pushed
the
fix/pstack-audit-space-paths
branch
from
October 24, 2026 02:06
647e0f5 to
67c94fd
Compare
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.
Problem
The worktree cleanup audit splits Git's porcelain paths at whitespace. A checkout such as
feature checkoutis audited asfeature, losing its commit and dirty-state information. A spaced main checkout also points the transcript lookup at the wrong directory; spaced transcript filenames are split by xargs.Change
Strip the
worktreeprefix without splitting the rest of the path, and pass literal, NUL-delimited transcript filenames from ripgrep to stat. Regenerate the Claude Code harness from the canonical pstack source.Verification
node --test pstack/skills/poteto-mode/scripts/worktree-audit.test.mjs: 2 pass.bash -n, harness generation/check, andgit diff --checkpass.No files are deleted by the audit or these fixtures outside their temporary directories.
Note
Low Risk
Read-only audit script behavior fix with regression tests; no data deletion or auth changes.
Overview
Fixes worktree path handling in
worktree-audit.shwhen checkouts or transcript paths contain spaces.Worktree listing: Replaces
awkfield splitting ongit worktree list --porcelainwithsedto strip theworktreeprefix so the full path (including spaces) is used for the main worktree, the audit loop, and transcript slug lookup.Transcript discovery: Uses
rg -l -0 -Fandxargs -0 statso ripgrep output and filenames with spaces are not broken by whitespace splitting.Adds
worktree-audit.test.mjswith offline Git fixtures (spaced and unspaced paths) that assert the audited worktree path, merge/clean columns, and on macOS recent-chat bucket behavior.Reviewed by Cursor Bugbot for commit 67c94fd. Bugbot is set up for automated code reviews on this repo. Configure here.