-
Notifications
You must be signed in to change notification settings - Fork 1k
tools.patch fails with new/deleted files #1807
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
Comments
Thanks for having a look at this, and the suggestion. I think we could try to use the proposed, maintained one, lets have a look. |
Could you please give a failing patch to apply? I guess it will be the typical ---- null, ++++new_file, right? We should add some test. |
Indeed, here is a minimum patch file that reproduces the error: diff --git a/newfile b/newfile
new file mode 100644
index 0000000..ea450f9
--- /dev/null
+++ b/newfile
@@ -0,0 +1 @@
+New file |
The https://github.com/vrajat/git-patch repo is just a wrapper over git, I think it is better to use a python solution, for those not using git. I have tried to contribute upstream: techtonik/python-patch#52 |
I agree. Not sure the repo is still maintained though, looking at the last closed issue which was in September 2016. Also I remember the |
I have proposed a local fix in: #1898 The upstream is abandoned, no response from PR. Also there is already a PR for that issue long time ago, without response Cannot find viable alternatives. Tried google patch-diff lib, but only from text-text no real unidiff with new and deletes. |
That's unfortunate... What about forking the repo? I don't see many options anyway. |
Released in 0.28 |
Hi @memsharded, I've tried to use
Was the forked patch dependency published to pip? |
No, finally conan implemented its own management of creation/deletion of files. Check it here. https://github.com/conan-io/conan/blob/develop/conans/client/tools/files.py#L174 There are conan tests covering this functionality: https://github.com/conan-io/conan/blob/develop/conans/test/util/conanfile_tools_test.py#L95 Maybe you could try to provide a failing test to replicate this issue? What is exactly your patch? Thanks for the feedback |
Sorry about that, it seems the warnings are not related to the failure I had earlier, the build passes with the warnings. I thought I saw in the Anyways it works :) |
Ok, great, glad that it is working, thanks for telling :) |
Hello,
I tried to apply a
.patch
usingtools.patch
, however the dependency conan is using does not handle new/deleted files. (see this line in particular).Furthermore, this library has not been updated in a year. This one looks maintained, I haven't tested it though.
To workaround that, I used
self.run
to launch git apply.The text was updated successfully, but these errors were encountered: