You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
collect_markdown_files in src/core/util.rs returns paths verbatim from ignore::WalkBuilder. When root is ".", every path carries a ./ prefix (e.g. ./examples/main.md). Downstream consumers — find_references, find_links, and the ReplacementPlan in mv.rs — inherit this inconsistency.
PR #7 worked around the mismatch for mv by introducing canonical_plan_key / find_matching_plan_key (O(n) linear scans with canonicalize() fallback). The workaround is correct but violates KISS: it exists only because the upstream data is ambiguous.
Additionally, find command output mixes ./examples/main.md (References section) with examples/main.md (Links section), which is confusing.
Target State
collect_markdown_files strips the ./ prefix at the source, so every path it returns is in the same "clean relative" form as user-supplied arguments.
canonical_plan_key / find_matching_plan_key and the resolve_path import are removed from mv.rs. All ReplacementPlan key operations revert to plain HashMap lookups.
find output shows consistent path forms (no leading ./).
Current State
collect_markdown_filesinsrc/core/util.rsreturns paths verbatim fromignore::WalkBuilder. Whenrootis".", every path carries a./prefix (e.g../examples/main.md). Downstream consumers —find_references,find_links, and theReplacementPlaninmv.rs— inherit this inconsistency.PR #7 worked around the mismatch for
mvby introducingcanonical_plan_key/find_matching_plan_key(O(n) linear scans withcanonicalize()fallback). The workaround is correct but violates KISS: it exists only because the upstream data is ambiguous.Additionally,
findcommand output mixes./examples/main.md(References section) withexamples/main.md(Links section), which is confusing.Target State
collect_markdown_filesstrips the./prefix at the source, so every path it returns is in the same "clean relative" form as user-supplied arguments.canonical_plan_key/find_matching_plan_keyand theresolve_pathimport are removed frommv.rs. AllReplacementPlankey operations revert to plainHashMaplookups.findoutput shows consistent path forms (no leading./).test_mv_relative_source_with_self_reference_succeeds,test_mv_relative_source_rewrites_external_reference) continue to pass, proving the source-level fix is sufficient.Rationale
findoutput becomes consistent.ReplacementPlankeys won't need to remember the./quirk.Scope
core
Safety Net