Skip to content

[Feature request] Fetch patch(es) from url #167

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

Open
rakannimer opened this issue Sep 5, 2019 · 4 comments
Open

[Feature request] Fetch patch(es) from url #167

rakannimer opened this issue Sep 5, 2019 · 4 comments

Comments

@rakannimer
Copy link

rakannimer commented Sep 5, 2019

Hey @ds300

Thanks for creating and maintaining patch-package, it has made my life much easier 👍

The Problem

I often find myself copy pasting patches from a codebase to another. While not a huge issue, it would be nice to avoid it.

Possible Solution

Instead of specifying the package name or git commit the user would provide a url pointing to where the patch is located.

patch-package would detect that it's a url, download the patches locally and then work as it does normally.

Is this something you would be interested to add ? Happy to take a shot at a PR if you are !

Cheers

@AnonymousArthur
Copy link

You should use git submodules to overcome your problem. Your URL solution will be much more complicated than using submodules.

@ds300
Copy link
Owner

ds300 commented Sep 6, 2019

Not sure that git submodules is a solution to this, but this feature has been requested a few times before and I'm not so keen on it. It has multiple problems to overcome:

  1. A url is not guaranteed to be available so your build might become flaky(er)
  2. A url is not guaranteed to be referentially transparent so we'd need to fingerprint the patch contents anyway or just put up with the possibility of breaking changes.
  3. You can't see the contents of a URL in a git diff so it makes the patch more difficult to review.

I might be tempted to add a --import command which takes a url and tries to create + apply a patch file based on that, but having the URL as a source of truth is problematic.

@AnonymousArthur
Copy link

having the URL as a source of truth is problematic this is exactly why I believe the submodule can solve his problem:

  1. he's facing patch re-using problem, git commands can be automated
  2. git can solve the source of truth problem without getting workspace messy
  3. everything above can be done without changing this repo

@AnonymousArthur
Copy link

And thank you for your passion to create this great tool, this thing saved my day.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants