Repository navigation
fix(init-workspace): migrate hand-added root gitignore lines into .gitignore.project - #1129
Merged
Merged
Conversation
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
The #1092 fix made
.gitignore.projectthe durable, preserved home for repo-root ignores, but the upgrade that introduces it seeds it empty: any root ignores a consumer had previously hand-added directly to the managed root.gitignore(.DS_Store, editor/OS cruft, project paths) were silently dropped when the upgrade regenerated the file from the template. Of the issue's two suggested fixes, this implements the preferred one — auto-migrate the consumer's lines into.gitignore.project— with the upgrade-note listing as its natural side output.Closes #1111
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.sh:.gitignorebefore the rsync overwrite (placed with the other pre-overwrite state captures).migrate_root_gitignore(), called just beforerender_gitignore(): appends to.gitignore.projectevery old-root line that is non-blank, non-comment, not a managed entry (template base + active language fragments + the [BUG] Managed .gitignore rewrite (#1024) drops consumer-required ignores with no durable committed extension point for repo-root paths #1092 seed), and not already in.gitignore.project. Append-only (never reorders/rewrites the consumer's existing entries), deduplicated, and idempotent — after the first migration the lines live in.gitignore.project, so later upgrades re-add nothing. PrintsMigrated N consumer line(s) into .gitignore.project (#1111):with the list..gitignoreviarender_gitignore()'s existing.gitignore.projectappend — no separate write.tests/bats/init-workspace.bats: three regression tests — migrate (lines land in.gitignore.projectand remain effective in the rendered root.gitignore, note printed), idempotence (second upgrade adds nothing), managed-lines-not-migrated.Changelog Entry
Fixed
.gitignorelines into.gitignore.projecton upgrade (#1111).gitignore.projectseam seeded it empty, silently dropping any root ignores a consumer had hand-added to the managed root.gitignore(regenerated from the template every upgrade)..gitignore.projectbefore the render — deduplicated, idempotent across upgrades, with an upgrade note listing what moved.Testing
just test)Manual Testing Details
.DS_Storemissing from.gitignore.project), turned GREEN by the fix.tests/bats/init-workspace.bats: 204 tests, 0 failures (implementation run + independent review run).prek run --all-files: green (including shellcheck on the new function).Checklist
docs/templates/, then runjust docs)CHANGELOG.mdin the[Unreleased]section (and pasted the entry above)Additional Notes
Wave 2 of the commit-action-deployment bug batch, branched after #1124 (same
render_gitignore()region) merged. Deliberate design choice worth noting: a template example line a consumer uncommented (e.g. activating.idea/) migrates into.gitignore.project— correct data preservation, since their active ignore survives the upgrade.Refs: #1111