Skip to content

Add an editor-friendly Git working tree review for vendored patches #1283

@sawachikaminoru

Description

@sawachikaminoru

Problem

dfetch diff can generate patch files for local changes to vendored projects, but large patches can be difficult to review as standalone files. A single patch may touch many files and hunks, making it hard for maintainers to inspect exactly what differs between the clean upstream source and the patched vendored source.

Reviewing the same changes as a Git working tree would make the workflow easier to navigate: editors such as VS Code can group changes by file, show side-by-side diffs, and let users inspect each modified file with their normal source control tools.

Proposal

Add a command that materializes a temporary Git repository for patch review.

Example:

dfetch review-patch SomeProject --code

Suggested default behavior:

  1. Create a temporary review directory.
  2. Fetch the selected project without applying patches.
  3. Initialize a Git repository and commit that clean upstream state.
  4. Apply the project patches.
  5. Leave the working tree dirty with exactly the patch differences.
  6. Optionally open the review directory in VS Code.

This would let users inspect the patch as normal Git working-tree changes.

Possible modes

dfetch review-patch SomeProject --mode combined
dfetch review-patch SomeProject --mode per-patch
  • combined: HEAD is clean upstream, working tree contains all patches applied.
  • per-patch: apply/review patches individually, or create one commit per patch.

Acceptance criteria

  • Users can review patched changes as normal Git working-tree changes.
  • The review directory contains a clean upstream baseline commit.
  • The working tree shows only meaningful patched differences.
  • Multiple patch files are supported.
  • Git, SVN, and archive-backed projects continue to work through dfetch’s existing fetch logic.
  • The command does not modify the real project checkout.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions