Back to Forgecode

Sample Merge Resolution Plan

.forge/skills/resolve-conflicts/references/sample-plan.md

2.12.103.2 KB
Original Source

Sample Merge Resolution Plan

This file provides a complete example of a merge resolution plan for a typical conflict scenario.

Merge Resolution Plan

Conflict Summary

  • Total conflicted files: 5
  • Deleted-modified conflicts: 1
  • Generated files: 1
  • Regular conflicts: 3

Resolution Strategy by File

1. Cargo.lock

Conflict Type: generated Strategy: Regenerate from Cargo.toml after merge Rationale: Lock files should never be manually merged; regeneration ensures all dependencies are correctly resolved Risk: Low - Standard procedure for lock files Action Items:

  • Choose either version temporarily
  • Run cargo update to regenerate
  • Stage the regenerated file

2. src/utils/helpers.rs (deleted in incoming, modified in current)

Conflict Type: deleted-modified Strategy: Backup modifications and apply to new location if applicable Rationale: File may have been moved/renamed; need to preserve modifications Risk: Medium - Requires analysis of where changes should go Action Items:

  • Run handle-deleted-modified script to create backup
  • Review analysis report for potential relocation targets
  • Apply modifications to new location if found

3. src/lib.rs

Conflict Type: imports Strategy: Merge all unique imports from both branches Rationale: Both branches likely added new dependencies; combining ensures all code works Risk: Low - Standard import merge pattern Action Items:

  • Extract imports from both sides
  • Deduplicate and sort by module
  • Verify no unused imports

4. tests/integration_test.rs

Conflict Type: tests Strategy: Include all test cases from both branches Rationale: Both branches added new test coverage; all tests should be preserved Risk: Low - Tests are additive Action Items:

  • Merge test functions from both branches
  • Combine test fixtures if needed
  • Ensure no duplicate test names

5. src/config.rs

Conflict Type: code logic Strategy: Need user input - both branches modify validation logic differently Rationale: Cannot determine correct business logic from code alone Risk: High - Affects core validation behavior Action Items:

  • Present both approaches to user
  • Get user decision on which validation logic to use
  • Implement chosen approach

Execution Order

  1. Phase 1: Deleted-Modified Files - Handle helpers.rs backup and analysis
  2. Phase 2: Generated Files - Regenerate Cargo.lock
  3. Phase 3: Low-Risk Merges - Merge imports in lib.rs and tests in integration_test.rs
  4. Phase 4: High-Risk Merges - Resolve config.rs after user input
  5. Phase 5: Validation - Compile, test, verify

Questions/Decisions Needed

  • src/config.rs: Validation logic conflict - which approach should we use?
    • Current branch: Validates using regex patterns
    • Incoming branch: Validates using a validation library
    • Options: (1) Keep current, (2) Keep incoming, (3) Use both with feature flag

Validation Steps

  • Run conflict validation script
  • Compile with cargo check
  • Run full test suite with cargo test
  • Manual verification of config.rs changes