-
-
Notifications
You must be signed in to change notification settings - Fork 286
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
Inconsistent information provided when patching fails #20
Comments
Thanks for the detailed report. I was hoping naïvely that that particular error message would only be shown when the versions do not match, but there seems to be some inconsistency with whitespace on Windows which means that perfectly good patches are not able to be applied by Git. I managed to fix this for a colleague by having him set |
I've figured out what's causing this issue, and it goes away if I re-write the patch files to get rid of CRLFs before applying them, regardless of whether the source files they're patching have CRLFs or just LFs. I'll push a fix out tonight. |
This should be fixed now so I'll close this issue too. Thanks again for your report! If the issue remains for you please re-open this. |
I'm experiencing the same issue with version 3.4.1 unfortunately. I'm patching a different package but I get the exact same result.
|
Upon further investigation, I discovered that the patch generated by version 3.4.1 is 132,150 lines long. The only change I made was to comment out a single line in the original file. The patch file that was being generate by version 3.4.0 looked like this:
|
Can you check whether you had Xcode running when you made the patch? Xcode edits files in node_modules while it's running. If not, mind zipping up the patch file for me to take a look at? I'm looking into the other issue now. |
I've double-checked and 3.4.1 at least fixed the version of this issue that I managed to reproduce which was this:
Does that differ from what you're doing? |
the .gitattributes change fixed the problem! I decided to document the steps that I followed before I even began the experiment so I'm leaving those steps here in case someone can benefit from them. Here are the steps I'm using to reproduce this.
The sample app compiles, installs and runs without error. The next step is to add a dependency that requires a patch.
I change line 61 of FBSDKPackage.java to this:
The app compiles and runs so the next step is to generate the patch.
The generated patch file is 132,706 lines long... too big for here so I made it available [here]
Deleted the patch file
reinstated it
dumped node_modules
updated package.json and committed
I tried to re-install dependencies and got this nice new error message:
updated git attributes with the suggested addition, committed that change... (now I understand what you meant by the last comment!)
so I removed the existing patch file again, reapplied the fix, regenerated the patch with
and got this:
That's more in line with what I expected so I committed that new file and re-installed by dependencies again
Bingo!
Thanks for this fix! |
This issue seems to be similar to #19 so I updated my yarn and node versions. I am on 64-bit Windows 10 with yarn v1.1.0, node 8.6.0 and npm v5.3.0. I can successfully generate a patch file and I have successfully applied the very same file in the past with
$yarn prepare
. I have noticed that this issue seems to occur when I switch branches in git.Note that the info: section seems to indicate a belief that the version numbers are out of sync but they are actually identical. Better error messages would be helpful for debugging this.
Here is the package.json file from the library I'm trying to patch in my node_modules folder:
and here is the patch file itself:
The text was updated successfully, but these errors were encountered: