Skip to content

Remove redundant doctor command in favor of apply --dry-run#16

Merged
satococoa merged 5 commits intomainfrom
copilot/discuss-doctor-command-necessity
Apr 5, 2026
Merged

Remove redundant doctor command in favor of apply --dry-run#16
satococoa merged 5 commits intomainfrom
copilot/discuss-doctor-command-necessity

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 5, 2026

doctor was effectively a dedicated wrapper around dry-run behavior. This change removes that duplicate command surface and makes apply --dry-run the single diagnostic path.

  • CLI surface

    • removes the doctor subcommand from the root command
    • keeps dry-run diagnostics on apply, with --verbose as the richer human-readable mode
  • Engine cleanup

    • removes DoctorOptions, DoctorReport, and Engine.Doctor()
    • relies on existing Apply(..., DryRun: true) metadata/output instead of maintaining a parallel execution path
  • Docs

    • removes the doctor section from the README
    • updates apply flag docs to point users to --dry-run --verbose for diagnostics
  • Tests

    • replaces doctor-specific CLI and engine assertions with equivalent apply --dry-run coverage
    • keeps compatibility-hint and include-resolution checks on the dry-run path

Example:

# before
git-worktreeinclude doctor --from auto --include .worktreeinclude

# after
git-worktreeinclude apply --dry-run --verbose --from auto --include .worktreeinclude

Copilot AI changed the title [WIP] Discuss necessity of doctor command Remove redundant doctor command in favor of apply --dry-run Apr 5, 2026
Copilot AI requested a review from satococoa April 5, 2026 02:22
@satococoa satococoa marked this pull request as ready for review April 5, 2026 02:27
Copilot AI review requested due to automatic review settings April 5, 2026 02:27
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Removes the redundant doctor CLI surface and consolidates diagnostics into the existing apply --dry-run --verbose path, simplifying both CLI and engine APIs.

Changes:

  • Removed doctor subcommand from the CLI and documentation; positioned apply --dry-run --verbose as the diagnostic workflow.
  • Removed Engine.Doctor() and associated types, relying on Apply(..., DryRun: true) metadata instead.
  • Updated integration/unit tests to validate the dry-run diagnostic path instead of doctor.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
README.md Removes doctor docs and points diagnostics users to apply --dry-run --verbose.
internal/engine/engine.go Deletes DoctorOptions/DoctorReport and Engine.Doctor(), consolidating on Apply.
internal/engine/engine_integration_test.go Replaces Doctor() assertions with Apply(..., DryRun: true) coverage for metadata/hints.
internal/cli/cli.go Removes doctor command wiring/implementation and codedOrDefault helper.
internal/cli/cli_unit_test.go Drops unit test for the removed codedOrDefault helper.
internal/cli/cli_integration_test.go Replaces doctor CLI tests with apply --dry-run --verbose equivalents.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI and others added 3 commits April 5, 2026 13:57
- Add DryRun bool field to Result struct (JSON: "dry_run")
- Split Summary.Copied into Copied (real mode) and CopyPlanned (dry-run mode)
  with omitempty for mutual exclusivity
- Update executePrepared to increment CopyPlanned in dry-run, Copied in real mode
- Update SUMMARY human output to use copy_planned= in dry-run mode
- Update jsonResult struct in CLI integration tests
- Add TestApplyDryRunJSON CLI integration test
- Add TestEngineApplyDryRunCopyPlanned engine integration test
- Update README with separate dry-run and normal JSON output examples

Agent-Logs-Url: https://github.com/satococoa/git-worktreeinclude/sessions/b43b6731-413f-4d2f-ae93-143bd52bfa32

Co-authored-by: satococoa <31448+satococoa@users.noreply.github.com>
…ummary-split

feat: distinguish dry-run copies in JSON and human output
@satococoa satococoa merged commit 22fa6b1 into main Apr 5, 2026
4 checks passed
@satococoa satococoa deleted the copilot/discuss-doctor-command-necessity branch April 5, 2026 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants