OpenPonk / openponk

The OpenPonk modeling platform
https://openponk.github.io/
MIT License
42 stars 9 forks source link

Problem with line endings while committing to OpenPonk repositories #51

Open hernanmd opened 3 years ago

hernanmd commented 3 years ago

Probably it's me but I tried two commits from Pharo 9, one from macOS and another one from Windows, and in both cases the line endings are always taken into account when comparing diff:

This is a commit from Windows:

https://github.com/hernanmd/openponk/commit/e3824fefe4b99b3eb0dece633b2e37d1b30e8ece

The OpenPonk repositories are the only ones where I have this problem. Should I set something else before committing to this repo?

JanBliznicenko commented 3 years ago

Hello, thank you for noticing the problem. It seems some files have Windows and some Unix line endings (CRLF vs LF). Those causing you problems are ones with LFs (Unix-like) that are being replaced by CRLFs (Windows-like) by your git. There is no easy solution to this, as we (even I myself) develop in both Linux and Windows. It needs to be unified. Although you have problems with ones with LFs, git proposes using LFs via autocrlf setting and Pharo project itself uses LFs. That leads me to beliving that OpenPonk repo should switch to LFs as well, therefore I switched whole repository to LFs. The way to go from here would be now using autocrlf setting in git that should handle this issue. I actually wonder why have you not encountered same issue on any other project, as it is expected to hapen in any crossplatform project. Pharo/Iceberg itself generates files with line endings for the specific platform.