-
Notifications
You must be signed in to change notification settings - Fork 155
fbc: normalize line endings in some source files #121
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
Conversation
|
Good catch. |
|
Yes, there are only a few lines in each file which are CRLF, but instead of fixing them, this patch changes every other line, which is going to be break plain There are more files with mixed line endings or pure CRLF line endings: None of the C or asm files have mixed line endings. |
…& LF line endings (as seen on Linux), likely due to the patch that was applied at the time. And will not auto convert to CRLF even when autocrlf=true
|
@countingpine, thanks. I've made the changes and commit from Linux, and the pull request makes more sense. Only a few lines are changed now. (I force pushed to this same pull request, as there was no real need to keep the initial version. Interesting, that github keeps track of that too now apparently.) It looks like there was mixed CRLF and LF in the source files. I don't know, I guess that confuses autocrlf on windows? Here's how I normalized the line endings on Linux: Then, when checking out on windows, I tested, and seems everything gets converted to CRLF as expected. @rversteegen, the UTF-16 & UTF-32 files appear to be stored as binary. It does not appear that git recognizes these files as text, likely due the null bytes, so no EOL conversions are performed. I would suspect, depending on which system the file was last modified will determine if it the line endings are found as LF or CRLF. I'm not sure it matters for these files on windows or linux, since the end user needs a capable editor for sure when working with these files. I pieced this together from examples I found. |
|
All files in git are "stored in binary". The line ending conversion is something that happens when going between blob storage and files on disk. I couldn't tell you whether Speaking of bugs, the |
Heh, that's not what I mean, and you know it. :) I think we could make that claim for any storage system. Thanks though, I agree, that is the correct way to think about this problem. Looking around in the git source code, starting with The one-liner I posted, only determines if the files are seen as binary by git. And if the file is seen as binary, then no EOL conversion will occur. However, there are some cases where EOL conversion still does not occur, even though the file is not seen as binary (like mixed line endings, in "text" files). The "binary" files listed by the one-liner is only a subset of the files that do not get EOL conversions. Looking in git source Maybe can use Anyway, that's enough of that! |
|
I was being a bit curt, though what I meant is that git doesn't store any metadata on a file indicating whether it's binary or not, unlike svn, which also has similar line-end handling options. Or at least, that's what I thought, but I've just discovered I'm completely wrong: git has But thanks for that deep dive into the implementation details. And I filed that bug against |
This change is intended to normalize line endings for fbc source files.
Some source files were stored to the repository with LF line endings, apparently permanently, likely due to the patch, or perhaps the way the patch was applied at the time, last summer. For these specific files, they will not auto convert to CRLF line endings on windows even when autocrlf=true. This doesn't affect source code; if the IDE/editor correctly reads files with LF endings then no issue is noticed.