Repository navigation
fix(init): classify the preview through the pruned candidate emitter - #1722
Merged
Merged
Conversation
Two refutations alone pass vacuously if the report's row format ever changes; assert one known ADDED row first. Refs: #1716
3 tasks
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.
Description
#1715 made
COPY_PRUNE_NAMES=(.git .venv)the single source of truth for the copy step's prunes, consumed by both rsync copies and byemit_template_candidates(theu+wsweep, the substitution pass, the+xsweep). The--previewclassifier was left out because it needs the source-relative path for destinations that do not exist yet. It kept its own! -path "*/.git/*" ! -path "*/.venv/*", which differs in kind:-pathskips only a directory's contents, while the emitter, like rsync, prunes any entry named.gitor.venv. So a file with one of those names, at any depth, was reported as ADDED but never copied.dest → relis lossless — both sides glue with the same"$WORKSPACE_DIR/"— so the preview now consumes the emitter and strips the prefix. That deletes the duplicated walk and gains the-L/-mindepth 1/ basename-prune semantics for free. The emitter moves up next toCOPY_PRUNE_NAMES(a pure, verbatim move) because the preview block precedes its old definition point.-type fstays explicit (the emitter defaults to-true). The twodocs/issues|pull-requestspredicates stay, with their comment corrected: they came from #951 to mirror rsync excludes that #1466 later deleted, the template ships neither path, so they are report-only.The report is byte-identical on the pristine template:
--preview --forcebefore and after diffed clean (117 ADDED rows, same order) — the prune only removes entries and traversal order is unchanged.Type of Change
feat-- New featurefix-- Bug fixdocs-- Documentation onlychore-- Maintenance task (deps, config, etc.)refactor-- Code restructuring (no behavior change)test-- Adding or updating testsci-- CI/CD pipeline changesbuild-- Build system or dependency changesrevert-- Reverts a previous commitstyle-- Code style (formatting, whitespace)Modifiers
!) -- This change breaks backward compatibilityChanges Made
assets/init-workspace.shemit_template_candidatesmoved verbatim to just below theCOPY_PRUNE_NAMES/COPY_PRUNE_EXCLUDESblockwhile IFS= read -r -d '' workspace_file; do rel_path="${workspace_file#"$WORKSPACE_DIR"/}"; …fed byemit_template_candidates "$TEMPLATE_DIR" -type f ! -path "*/docs/issues/*" ! -path "*/docs/pull-requests/*"; everything downstream ofrel_path/workspace_fileunchanged; comment corrected (fix(workspace): upgrade file report over-reports ADDED (find walk misses rsync's .venv exclude) #951 / [BUG] Smoke deploy publishes consumer-owned files as deletions — the smoke repo loses its Python project #1466)tests/bats/init-workspace.bats.venvover-report test: a file.gitand a nested filepkg/.venvin the template must not appear as+ .git/+ pkg/.venvin--preview --force(refute_line, never--partial ".git") after a positive anchor on a known ADDED row, and neither exists after a real--forcescaffold. Ondevboth phantom rows appearChangelog Entry
No changelog needed — the issue says so; the visible change is two phantom preview rows for a template shape devkit does not ship.
Testing
just test)Manual Testing Details
bats -j 4:init-workspace.bats305/306 (the one failure is pre-existing and environmental — test 296 needs PyYAML in the plainnix developpython; identical at the parent commit),upgrade-atomicity.bats6/6,install.bats95/95--preview --forcereport before vs after: identicalshellcheck -xandbash -nclean; file mode still 100755;prek run --all-files→ 55 hooks passedChecklist
docs/templates/, then runjust docs)CHANGELOG.mdin the[Unreleased]section (and pasted the entry above)Additional Notes
Rewriting the script through a temp file and
mvsilently dropped its executable bit once during implementation; the structural BATS test caught it and the committed blob is 100755.Refs: #1716