Skip to content

Provide better DX when creating patches #670

@sc0rp10

Description

@sc0rp10

Verification

  • I have updated Composer to the most recent stable release (composer self-update)
  • I have updated Composer Patches to the most recent stable release (composer update cweagans/composer-patches)
  • I am using one of the supported PHP versions (8.0+)
  • I have searched existing issues and discussions for my idea.

Is your feature request related to a problem?

Hello!

I've been using this library for quite a while. I don't need to create patch files very often, but every time I do, it's a pretty painful experience. I always struggle with the patch format (which doesn't feel very intuitive to me), line numbers, file paths (which are relative to the vendor directory), and the overall testing flow.

Describe your proposed solution(s)

Have you considered providing a more developer-friendly way to create patches?

I imagine it as a simple console command that guides the developer through the process, for example:

  • Enter a patch name
  • Select a source file
  • The tool prints a temporary destination path to edit
  • The tool compares the source and destination and generates a patch
  • The patch file header is fixed automatically
  • Confirm whether to save the patch
  • Save the patch after confirmation

This is just a rough draft, but the general idea is to have a wizard-style workflow that helps developers create patches without having to manually deal with all the low-level details.

What do you think about it?

Describe alternatives

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew features, options, or other additions.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions