Skip to content

Commit 05b2f91

Browse files
committed
config/reader(chore[todo]): plan duplicate-aware loader alignment
why: ConfigReader still swallows duplicate workspace roots while vcspull fmt now preserves them.\nwhat:\n- document the divergence and outline options for sharing the duplicate-tracking loader introduced in November 2025.
1 parent 2fce454 commit 05b2f91

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

src/vcspull/_internal/config_reader.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,20 @@ def _from_file(cls, path: pathlib.Path) -> dict[str, t.Any]:
106106
assert isinstance(path, pathlib.Path)
107107
content = path.open(encoding="utf-8").read()
108108

109+
# TODO(#?): Align this loader with the duplicate-aware YAML handling that
110+
# ``vcspull fmt`` introduced in November 2025. The formatter now uses a
111+
# custom SafeLoader subclass to retain and merge duplicate workspace root
112+
# sections so repos are never overwritten. ConfigReader currently drops
113+
# later duplicates because PyYAML keeps only the last key. Options:
114+
# 1) Extract the formatter's loader/merge helpers into a shared utility
115+
# that ConfigReader can reuse here;
116+
# 2) Replace ConfigReader entirely when reading vcspull configs and call
117+
# the formatter helpers directly;
118+
# 3) Keep this basic loader but add an opt-in path for duplicate-aware
119+
# parsing so commands like ``vcspull add`` can avoid data loss.
120+
# Revisit once the new ``vcspull add`` flow lands so both commands share
121+
# the same duplication safeguards.
122+
109123
if path.suffix in {".yaml", ".yml"}:
110124
fmt: FormatLiteral = "yaml"
111125
elif path.suffix == ".json":

0 commit comments

Comments
 (0)