-
Notifications
You must be signed in to change notification settings - Fork 7
fix: preserve existing workspace .gitignore entries #43
Copy link
Copy link
Open
Labels
area: coreCore workspace, manifest, state, and runner behaviorCore workspace, manifest, state, and runner behaviorbugSomething isn't workingSomething isn't workingdev sprintPythonlings Community Dev Sprint August 2026Pythonlings Community Dev Sprint August 2026good first issueGood for newcomersGood for newcomerssize: SSmall, focused contributionSmall, focused contribution
Description
Metadata
Metadata
Assignees
Labels
area: coreCore workspace, manifest, state, and runner behaviorCore workspace, manifest, state, and runner behaviorbugSomething isn't workingSomething isn't workingdev sprintPythonlings Community Dev Sprint August 2026Pythonlings Community Dev Sprint August 2026good first issueGood for newcomersGood for newcomerssize: SSmall, focused contributionSmall, focused contribution
Motivation
Workspace initialization currently rewrites
.gitignorewith only Pythonlings-managed patterns. That silently discards learner or team ignore rules, including during forced initialization and update.Current evidence
pythonlings/core/curriculum.py::_write_workspace_gitignore()writes a replacement file fromGITIGNORE_LINES.init_workspace()andupdate_workspace()both call that helper.Exact scope
Change managed ignore handling to append only missing Pythonlings patterns. Preserve existing user lines exactly: no deletion, duplication, or reordering during init, force-init, or update.
Acceptance checklist
.gitignoreretains every original line in its original order..gitignoregets the managed patterns.Explicit exclusions
Do not normalize, sort, deduplicate, or otherwise rewrite user-authored ignore rules; do not change the managed patterns themselves.
Likely files
pythonlings/core/curriculum.pytests/unit/test_curriculum.pytests/integration/test_cli_workspace.pyVerification
Manually inspect before/after
.gitignorefixtures containing comments, blank lines, and an existing managed pattern.Sprint coordination
See the sprint Discussion. This issue is unassigned and is not a reservation.