Repository navigation
park and status read a root's legs out of .gitmodules with git config -z, so a submodule name with a space no longer loses the leg and a valueless key is never a path - #15
Conversation
… config -z`, so a submodule name with a space no longer loses the leg and a valueless key is never a path The plain `git config --get-regexp` output was split at its first space. A submodule whose NAME carries a space — `[submodule "sp ace"]` with `path = spec` — prints as `submodule.sp ace.path spec`, so the path came back as `ace.path spec`, a directory that does not exist, and the leg was silently left out: of park's not-carried report (an unpushed leg commit unreported), and of status's rows (a whole leg missing). A key with no value prints bare; status guarded it, park's `.git` test masked it. With `-z` each entry is `key<LF>value<NUL>` and a valueless key has no LF at all, so the split cannot be fooled either way. Both functions sit outside the shared resolver block, which is untouched. One test each side builds a root with a submodule named `sp ace` and a valueless key beside it: park must report the leg's unpushed commit, status must show exactly one leg row, and neither may print the mangled key. Suite 249 -> 251. Co-Authored-By: Claude Fable 5.1 <[email protected]>
There was a problem hiding this comment.
Sorry @brettheap, you've used your own review budget of 250,000 diff characters for the last 7 days.
You can request another review in 3 days and 5 hours by commenting @sourcery-ai review. Upgrade to get a review now.
Reviewer's GuideSwitches File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
There was a problem hiding this comment.
🟢 Approval recommended
The reviewed changes address the parsing issues and include regression coverage.
Pull request overview
This pull request fixes .gitmodules parsing in park and status for spaced submodule names and valueless keys.
Changes:
- Use NUL-delimited Git config records for safe key/value parsing.
- Add regression tests for both commands.
File summaries
| File | Summary |
|---|---|
tests/test_status_command.py |
Tests correct leg enumeration and status output. |
tests/test_park_resume_commands.py |
Tests spaced names and valueless keys in park. |
status |
Corrects declared-leg enumeration. |
park |
Corrects mounted-leg path extraction. |
Review details
- Files reviewed: 4/4 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.



Follow-up noted in #12's review. Both commands enumerate a root's mounted legs from
.gitmodulesand split the plaingit config --get-regexpoutput at its first space. A submodule whose NAME carries a space —[submodule "sp ace"]withpath = spec— prints assubmodule.sp ace.path spec, so the path came back asace.path spec, a directory that does not exist, and the leg was silently left out: ofpark's not-carried report (an unpushed leg commit unreported) and ofstatus's rows (a whole leg missing). A key with no value prints bare;statusguarded it,park's.gittest masked it.With
-zeach entry iskey<LF>value<NUL>, and a valueless key has no LF at all, so the split cannot be fooled either way:park'ssubmodule_pathsandstatus'sdeclared_legs, both outside the shared resolver block (verified byte-identical across the three commands).sp aceand a valueless key beside it:parkmust report the leg's unpushed commit,statusmust show exactly one leg row, and neither may print the mangled key. Suite 249 -> 251.bash -nand shellcheck unchanged.Small enough that no review round was run.
🤖 Generated with Claude Code
Summary by Sourcery
Correct
parkandstatussubmodule discovery so spaced names remain valid legs and valueless keys are excluded.Bug Fixes:
parkandstatusread root.gitmodulesentries..gitmoduleskeys instead of treating them as paths or phantom legs.Tests:
parkandstatus.