Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved DX for patch-package --partial #486

Open
karlhorky opened this issue Aug 22, 2023 · 0 comments
Open

Improved DX for patch-package --partial #486

karlhorky opened this issue Aug 22, 2023 · 0 comments

Comments

@karlhorky
Copy link

karlhorky commented Aug 22, 2023

As a user of patch-package --partial, I would love if this mode would evolve into an interactive mode which allows for discarding conflicting hunks of the patch (to allow editing of the patch without users editing files in node_modules/) with a workflow similar to:

  1. User runs patch-package --partial
  2. All patches which apply are applied as normal, without any user interaction
  3. Any patches containing hunks which do not fully apply are presented to the user hunk by hunk to resolve conflicts
    1. Similar to git add --patch, a conflicting hunk is shown to the user with the question "Discard?"
    2. If the user answers "yes" to the "Discard?" question, the hunk will be removed from the patch file by patch-package
    3. Possible additional improvement: if the user answers "yes" to all "Discard?" questions for a patch, the patch file will be updated with the current version number of the package
    4. If the user answers "no" to any of the "Discard?" questions, the patch process is aborted with exit code 1

Making it default: This new interactive mode could arguably also become the default for patch-package, and the --partial option dropped - falling back to the previous (non-partial) default mode if the terminal is non-TTY.

Alternatives considered

A (simpler) alternative would be a new flag --discard-conflicts or similar, which would be a non-interactive command that would act as if the user answered "yes" to all of the "Discard?" questions mentioned above.

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

No branches or pull requests

1 participant