-
-
Notifications
You must be signed in to change notification settings - Fork 239
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
Use patch instead of git apply #172
Comments
-1 for these reasons (in no particular order):
|
I'd like to second the original request by @danepowell. I just got bitten by the bug caused by the silent failure of git apply in #174. Also, cloning everything from source may allow |
Is there a workaround that doesn't affect all the rest?
I'm all for that. |
Ah crap, I missed |
I'm currently running into an issue with patching, where patches created with e.g.
From the git format-patch docs:
|
Does |
The patch that I noticed was having the issue was https://www.drupal.org/node/2883813, being applied by acquia/lightning 2.2.7. The Drupal.org documentation on creating patches only recommends |
The git docs aren't 100% clear on how renames work, and specifically the --no-renames argument:
I interpret that as meaning that by default, If that's true, then the patch you found is a fluke and should be corrected. I will also update the d.o patch docs to call this out. |
Some patches created with Git contain binary diffs, generated using |
You need GNU Patch >= 2.7. From their News page (https://savannah.gnu.org/forum/forum.php?forum_id=7361) about 2.7:
|
@Apteryks I spend several hours to find what's going wrong, thanks to you advice, My mac's patch version is 2.5, After I update patch to 2.7.6, every thing works fine with rename. |
@lawxen I tried searching for the ways to install patch 2.7.6 on macbook, I couldn't find, could please help me out on this? |
@navneet0693 |
@cweagans holy shit, the need for |
It works like a charm |
I 100% agree with @danepowell, Plus, it would allow us patch appliance for dist installation method, which is great. If |
this worked for me! |
|
Following up on the conversation here: #165
Currently, composer-patches tries to use
git apply
to apply patches, and falls back to GNU patch if that fails. I think we should reverse this logic, or eliminategit apply
altogether.The reason being that you can't run
git apply
inside of a git repo that's a parent of the project getting patched. This probably describes 90% of the environments where composer patches is used, sogit apply
would almost never work.What I mean by this: let's say you have a project foo that depends on package bar. You obviously keep foo in git, so your directory structure looks like this:
And now you want to apply a patch to bar. You can't do this with git apply, because
foo/
is the git repo root, but git apply expectsfoo/vendor/bar/bar
to be the repo root.@cweagans mentioned in #165 (comment):
I'd be surprised if that's true. I've never run across a *nix environment that didn't have patch installed. The only place I can imagine this being true is for Windows users running outside of the Ubuntu subsystem (which is not a recipe for success to begin with).
The text was updated successfully, but these errors were encountered: