-
-
Notifications
You must be signed in to change notification settings - Fork 242
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
So it doesn't work when not using Git? #115
Comments
It will work without git. Try it and let me know if it doesn't. |
Let me explain. From the project's main page it's clear that packages are expected to be installed as sources: "config": {
"preferred-install": "source"
} and when I enabled verbose output and seen that list of After some debugging I've found the code which really executes after all attempts to apply a patch i.e. when
so it falls back to using Still I have two questions:
|
The reason preferred-install is source is that git is better at resolving patch conflicts when it has some history to go off of, rather than just the current state of the file. Even if preferred install is dist though, git apply will still work as long as you set the GIT_DIR env variable (or pass the --git-dir argument) to the root of the project that you want to apply a patch to. In the rare case where |
(also, preferred-install: source doesn't really hurt anything. it takes more disk space, but other than that, it should be fine) |
Thank you for the quick reply. It's really big news to me - didn't know that git can run in such a unattended mode, it explains everything then! And that it couldn't apply a patch in my case means probably a bad patch formatting idk, I'll check it. Thank you very much, Cameron! Btw, GIT_DIR seems to be removed in c76046e
Hehe, that was my case. But as I said - I'll see what's wrong. |
In theory, cd'ing to a dir should have worked, but it wasn't well tested, so we're adding --git-dir back in #108. |
I created a patch for a released version of a package and was expecting composer-patches would work but from the output I see that it doesn't:
so it runs
git
to apply patch instead ofpatch
. Is there a way to apply patch to a released (dist) version instead of sources, cuz I don't need any.git
repos undervendor/
(as it is distributed with the application)?The text was updated successfully, but these errors were encountered: