Skip to content
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

Update documentation for Windows #21

Closed
alexandrospanagiotidis opened this issue Sep 29, 2017 · 5 comments
Closed

Update documentation for Windows #21

alexandrospanagiotidis opened this issue Sep 29, 2017 · 5 comments

Comments

@alexandrospanagiotidis
Copy link

alexandrospanagiotidis commented Sep 29, 2017

Recently I used patch-package (3.4.0) on macOS (which worked very well) but my colleagues on Windows got an error during npm install. I followed the documentation, i.e., I set autocrlf=true on Windows but this did not help.

After investigating this issue, I found the following:

  • git apply skipped the patches on Windows
  • the patches created on macOS could be applied manually on Windows using patch (from git-bash)
  • creating the patches anew on Windows via patch-package worked (i.e., npm install did not error out, patches were applied)

I compared the patches created on macOS with those on Windows and found that they were exactly the same, except that the newly created patches on Windows did NOT have CRLF but LF ending.
Then I removed the autocrlf setting and forced LF EOL on patch files via .gitattribute and then the patches from macOS worked, too.

So, I propose to change the documentation, stating that autocrlf is not necessary. Instead, create a .gitattributes file in the patches folder containing at least this:

*.patch eol=lf
@ds300
Copy link
Owner

ds300 commented Sep 29, 2017

Thanks, this chimes with what I discovered while debugging #20 last night. I'll try that out and update the README if it goes smoothly.

@ds300
Copy link
Owner

ds300 commented Sep 29, 2017

Works like a charm! Would never have realised that you can control EOL characters for particular extensions with .gitattributes. Thank you 🙇

@alexandrospanagiotidis
Copy link
Author

alexandrospanagiotidis commented Sep 29, 2017

Thank you for patch-package 🙇
Maybe you should note, that the .gitattributes work-around only works if people actually use Git and that the files need to be checked out, as the conversion happens during checkout (i.e., if the files are already there, they need to be checked out again).

@ds300
Copy link
Owner

ds300 commented Sep 29, 2017

Good idea, I'm noting that, as well as adding a contextual error message to point people in the right direction when patch application fails for this reason.

@ds300
Copy link
Owner

ds300 commented Sep 29, 2017

I've updated the README now to reflect the changes you suggested. Thanks again! Really big improvement!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants