Line Endings
How Qualcomm® Package Manager Releases are Published
All code posted on Qualcomm® Package Manager is published to your repository using Unix-style line endings in order to keep diffs and merges smooth.
Windows Installer Line Ending Configuration Choice
During installation of Git on a Windows machine, you are prompted to choose the style of line endings you wish Git to use upon file checkout to your computer.
If you are using a Windows machine to download code for Linux, you will want to choose the second option, as that does not replace LF with CRLF for line endings. Build commands can fail if certain files have CRLF endings.
If you are using a Windows machine to download code for Windows Phone (WP) or Windows on Arm (WA) HLOS software products, you will want to choose the first choice, otherwise the source code will have Unix-style line endings and the code will not compile.
Qualcomm® Package Manager is a Qualcomm-to-Customer distribution tool only. Line endings settings for the commit direction can be ignored as Qualcomm® Package Manager is only used for distribution of code from Qualcomm to customers, not the other way around.
Changing the Line Ending Configuration
You can change this by either re-installing Git and choosing the appropriate setting, or, using the following command to configure Git globally:
git config --global core.autocrlf true // Checkout files Windows-style git config --global core.autocrlf input // Checkout files as-is on ChipCode (Unix-style) git config --global core.autocrlf false // Checkout files as-is on ChipCode (Unix-style) Git will automatically manage line endings for you if you set the core.autocrlf option. On Windows, you usually want to use true for this setting.
Once you have made this change, clone your repository again and the files will be set to use the line ending styles you have set.
Verify Your Global Git Config
You can check your global Git configuration for line endings by opening the file in your home directory (~) named .gitconfig and looking for the value set to autocrlf:
[http]
sslVerify = false
[core]
autocrlf = input
Distribution of files with Windows-style Line Endings
Git handles line endings for files based on the preference for both the Publisher tasks that our automation uses (posting to ChipCode) as well as when the customer downloads (clone or pull). During the process of publishing this code to ChipCode, files with Windows line endings (CR+LF) are converted to Unix-style line endings (LF) automatically. If you prefer to download the file with Windows-style line endings, you can configure your git client to do so (see above)
This is another benefit for using ChipCode. Git manages line endings based on dynamic user preference; your are not forced to use line endings from the original source, which is the case when dealing with zipped original source files.
In the past, downloading ZIP files via Docs & Downloads required the line endings in the files to must match customer expectations. This is no longer necessary with code delivered via Qualcomm® Package Manager.
Recommended Settings
Qualcomm recommends keeping line endings as LF on your end in order to keep diffs and merges smooth. Here is also a really good write-up on line endings, including the ability to change line endings depending on file extension. https://help.github.com/articles/dealing-with-line-endings
Git Attributes to Ignore File Extensions when changing line endings
You can create a file named .gitattributes in the root directory of your project that contains a list of files you want to tell git to always assume are binary. That way, git will never touch files with that extension when checking out the files and changing the line ending style, based on your core.autocrlf setting.
Qualcomm now distributes this file automatically for all Qualcomm repositories. For older repositories that do not have this file at the root, you can manually create a .gitattributes file and place it in your project’s root directory to ensure that these files will not be modified by git.
*.o binary
*.obj binary
*.lib binary
*.bin binary
*.mbn binary