Comments (13)
Published in 3.6.0 🎉
from patch-package.
Thanks for the report!
Unfortunately I can't reproduce the issue on windows server 2016. What's your setup? i.e. windows version, shell, git version, etc?
What output you do get for this command:
git apply --verbose --ignore-whitespace --whitespace=nowarn patches/jison-lex+0.3.4.patch
Is it any different if you use this:
git apply --verbose --unsafe-paths --ignore-whitespace --whitespace=nowarn patches/jison-lex+0.3.4.patch
?
from patch-package.
Windows 10. I am using Cygwin, but same is reproduced under windows cmd.
However, I believe my git is from Cygwin installation (apt-cyg install git
).
$ which git
/usr/bin/git
$ git --version
git version 2.7.0
The output of both commands is just empty. No changes are applied to the files as well.
from patch-package.
Hmm that version of git is a couple of years old. Could be the issue. The one cygwin installed for me is 2.14 and it works fine:
from patch-package.
Well I went through all the pain of updating my cygwin 😃 (after updating git through apt-cyg
it did not work because it required me to update whole cygwin) Unfortunately, the problem did not disappear. I will check tomorrow on another Win10 machine at my office.
The only difference is that both commands now report the following instead of empty report:
$ git apply --verbose --unsafe-paths --ignore-whitespace --whitespace=nowarn patches/jison-lex+0.3.4.patch
Skipped patch 'node_modules/jison-lex/regexp-lexer.js'.
from patch-package.
I've done some more testing and found that it works the first time, but I get the error if I run patch-package a second time on already-patched files. Might be related, still investigating.
It just occurred to me that the git commands I gave to you wouldn't work anyway because of the fact that your npm project is not at the git root. In that case, patch-package rewrites the patch file to make the file paths relative to the git root, but maybe it's possible to avoid that rewriting by generating patch files that aren't tied to a git index. I'll look in to that as well.
Maybe you could try renaming the [Stanford] Compilers
folder to something that doesn't contain any 'special' characters, then regenerating the patch file. It might be the cause of the issue on your machine.
Sorry about the trouble, and thanks again for the report!
from patch-package.
wouldn't work anyway because of the fact that your npm project is not at the git root
It looks like the fact that I have a .git root in parent directory is exactly the issue (also mentioned here in the last response).
If I move the directory to a different location, or even if I simply remove the .git
folder from parent, it works fine.
This behavior is fine as far as I am concerned, certainly a minor thing if you know it. I can work around that. Thanks!
from patch-package.
@roman-spiridonov I released a beta version with a slightly different way to handle these kinds of situations. It would be cool if you could try it: npm i --save-dev patch-package@beta
from patch-package.
I just published it under 3.5.3 - If I don't hear back from you in a few days I'll close this issue. Thanks again!
from patch-package.
Unfortunately still getting the same behavior.
I am not able to apply patch because .git
folder (git root) is in upper directory.
If I remove the .git
folder, it works just fine.
Also, notice that additional information about .gitattributes
has disappeared in the new release (maybe this is fine, just noticing).
Here is the sequence of steps to reproduce:
$ patch-package
patch-package: Applying patches...
**ERROR** Failed to apply patch for package jison-lex
This error was caused because Git cannot apply the following patch file:
patches/jison-lex+0.3.4.patch
This is usually caused by inconsistent whitespace in the patch file.
$ mv ../../.git ../../.git~
$ patch-package
patch-package: Applying patches...
[email protected] ✔
from patch-package.
Argh :(
Can you try deleting the first two lines of the patch file (beginning with diff
and index
) and running the git apply
command again?
git apply --verbose --ignore-whitespace --whitespace=nowarn patches/jison-lex+0.3.4.patch
I removed the .gitattributes warning because whitespace inconsistencies should no longer prevent patches from being applied.
from patch-package.
It worked!
$ git apply --verbose --ignore-whitespace --whitespace=nowarn patches/jison-lex+0.3.4.patch
Checking patch [Stanford] Compilers/cool-jison/node_modules/jison-lex/regexp-lexer.js...
Applied patch [Stanford] Compilers/cool-jison/node_modules/jison-lex/regexp-lexer.js cleanly.
from patch-package.
Great! I should have a permanent fix for this later tonight.
from patch-package.
Related Issues (20)
- Add support for yarn v2+ HOT 6
- Patching Git modules without version HOT 3
- Warn when patch exists for old version of package HOT 5
- [Proposal] Reduce `patch-package` installation size HOT 2
- [Discussion] Global patches HOT 1
- New patch parse failed
- Add new dependency to a package
- Does patch-package support node12? HOT 1
- Failed to apply patch for package react-native-agora HOT 1
- Is there a way to convert pnpm patches to patch-package patches? Or do they use the same format? HOT 2
- -
- Uniterpretable Error during makePatch HOT 4
- react-native-otp-verify+1.1.6.patch
- Confusing syntax error message when pointing to a package that does not exist
- Patch not applied after package upgrade
- inflight - Missing Release of Resource after Effective Lifetime HOT 1
- how get the post-install to run when installing cosmos (or storybook and the like)
- Patch cannot be applied when it simultaneously renames and modifies the file HOT 1
- npx patch-package [email protected] error
- Not sure if I'm clear on how to re-apply updated patch...
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from patch-package.