Objective
Show a diff in sync summaries when overwrite would replace consumer files, instead of silently relying on backup files.
Current Limitation
When --overwrite replaces an existing consumer file, maintainers need to understand exactly what changed. Backup files can reduce data loss, but a clear diff in the sync summary is more useful for review and CI logs.
Proposed Work
Enhance overwrite reporting so dev-tools:sync displays a readable diff for overwritten files. Prefer using an existing PHP diff library already available through PHPUnit or its dependencies, when suitable, instead of implementing a custom diff engine.
Scope
- Show before/after diffs for overwritten file resources.
- Include the path being overwritten and the source resource.
- Integrate with the final sync summary when available.
- Keep output readable in terminal and CI logs.
- Avoid writing backup files as the primary strategy unless a separate explicit option is introduced later.
Non-goals
- Creating backup files by default.
- Implementing an interactive prompt.
- Showing diffs for binary files in the first implementation.
Acceptance Criteria
Functional Criteria
Architectural / Isolation Criteria
Objective
Show a diff in sync summaries when overwrite would replace consumer files, instead of silently relying on backup files.
Current Limitation
When
--overwritereplaces an existing consumer file, maintainers need to understand exactly what changed. Backup files can reduce data loss, but a clear diff in the sync summary is more useful for review and CI logs.Proposed Work
Enhance overwrite reporting so
dev-tools:syncdisplays a readable diff for overwritten files. Prefer using an existing PHP diff library already available through PHPUnit or its dependencies, when suitable, instead of implementing a custom diff engine.Scope
Non-goals
Acceptance Criteria
Functional Criteria
dev-tools:sync --overwritereports a diff for each text file it replaces.Architectural / Isolation Criteria