GithubHelp home page GithubHelp logo

Comments (11)

ds300 avatar ds300 commented on June 9, 2024

Hi! 👋! Thanks for the report!

There seems to be an issue with the way the patch file was generated on your machine. It is missing the a/ andb/ prefixes for the file paths. i.e. it should look like this:

❯ cat patches/localforage+1.7.1.patch
diff --git a/node_modules/localforage/src/drivers/indexeddb.js b/node_modules/localforage/src/drivers/indexeddb.js
index c77786f..f54a612 100644
--- a/node_modules/localforage/src/drivers/indexeddb.js
+++ b/node_modules/localforage/src/drivers/indexeddb.js
@@ -664,7 +664,12 @@ function setItem(key, value, callback) {

                             resolve(value);
                         };
-                        transaction.onabort = transaction.onerror = function() {
+
+                        transaction.onerror = function() {
+                            reject(req.error);
+                        };
+
+                        transaction.onabort = function() {
                             var err = req.error
                                 ? req.error
                                 : req.transaction.error;

I think this is supposed to be part of the git spec: https://git-scm.com/docs/git-diff#_generating_patches_with_p but maybe there are certain environmental factors which could prevent these prefixes from being included. Are you aware of anything?

Otherwise, it would be great to know which OS and git version you're working with. As well as any custom global git configuration you can share.

from patch-package.

gonzaloserrano avatar gonzaloserrano commented on June 9, 2024

Good to know!

from patch-package.

gonzaloserrano avatar gonzaloserrano commented on June 9, 2024

Digged a little and probably is because I'm using custom diff stuff to colorize etc, so maybe adding a flag here

tmpExec("git", ["diff", "--cached", "--name-only"])
like git diff --no-ext-diff could work (haven't tried).

from patch-package.

ds300 avatar ds300 commented on June 9, 2024

I think this is the culprit:

https://github.com/gonzaloserrano/configs/blob/0de92c77268bfec42e4d82cab6442e4fb2e474d1/gitconfig#L40

I didn't realise this was an option until now :) Out of interest, why do you have that option set?

from patch-package.

gonzaloserrano avatar gonzaloserrano commented on June 9, 2024

Thank you! That must be it.

Probably it was done when I tried this tool https://github.com/so-fancy/diff-so-fancy.

I will get rid of it and try again.

from patch-package.

AlexHuicu avatar AlexHuicu commented on June 9, 2024

This is also happening to us.
I tried to use this version in order to fix the "inconsistent white spaces" problem, but run into this one.

It's happening when someone updates/creates a patch on mac and that patch is applied on a windows machine.
This is the log:
2018-07-23T10_17_25_952Z-debug.log

This is the smallest project in which the problem occure. I've included an old patch that was working and the new one, which throws the error above, with my node modules:
https://drive.google.com/open?id=1xnNnOMWR6VJ-x6QC3BbZsS0jT3odgHXN

This is the project without node modules:
patch-test.zip

yarn version:1.7.0
node version: 8.11.3
npm version: 5.1.0
lerna version:2.11.0 (i belive not necessary)
Windows 10 Pro, version 10.0.17134 Build 17134

The patch can by applyed by running "lerna bootstrap" in the main folder, or by runnint "git apply.." in the "first" forder. The result is the same

If you need more details, I m happy to help.

from patch-package.

AlexHuicu avatar AlexHuicu commented on June 9, 2024

I tried to bypass this error by reverting the patch to the old one, making the saves myself and running "patch-package".
It applyed it correctly and the app worked. The first time.

Unfortunately, the second time I run yarn, the patch-package failed with the "inconsistent whitespace" problem.
My workaround is to delete the patched node module every time I run yarn.

This is the newly created patch, on the windows machine(I changed it's extension to be able to upload it here):

react-native-charts-wrapper+0.4.3.txt

from patch-package.

AlexHuicu avatar AlexHuicu commented on June 9, 2024

Edit:
The workaround did not work. I'm not able to build for a few hours know

from patch-package.

ds300 avatar ds300 commented on June 9, 2024

Hi @alexhuiculescu ! 👋 Thanks for the report!

I just got back from a long holiday and have a lot of issues to work through over the next few days. Rest assured this one is a high priority. Thanks for your patience. 🙏

Which cli environment are you using on Windows?

from patch-package.

AlexHuicu avatar AlexHuicu commented on June 9, 2024

I'm using VSCode with cmd as default terminal

from patch-package.

AlexHuicu avatar AlexHuicu commented on June 9, 2024

Edit: using the built in VSCode command to replace LF with CRLF on the commited files did the trick. I've just made the changes myself while standardizing the end lines with Windows end-line style

from patch-package.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.