Skip to content

Fix diff parsing logic to correctly extract file paths and line counts #82

@oleander

Description

@oleander

Task

Fix the diff parsing logic in src/multi_step_integration.rs to correctly handle standard git diff formats.

Requirements

  • Accurately extract file paths from git diff headers by recognizing the diff --git a/path b/path format
  • Strip the conventional a/ and b/ prefixes that git uses
  • Handle special cases:
    • Newly added files (old path is /dev/null)
    • Deleted files (new path is /dev/null)
    • Renamed files (capture both paths)
  • Correct line counting:
    • Lines beginning with + are additions
    • Lines beginning with - are removals
    • Exclude metadata lines (+++ or ---)
  • Infer file structure from available context when headers are missing
  • Only default to "unknown" filename after exhausting all parsing strategies

Success Criteria

  • Parser successfully extracts correct file paths from standard git diff output
  • Line counts accurately reflect additions and removals
  • No more "unknown" filename issues in debug output
  • File paths appear as actual repository paths, not generic placeholders

Part of #81

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions