News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

LF and CRLF in C::B files

Started by AdiShavit, July 29, 2010, 02:45:24 PM

Previous topic - Next topic

AdiShavit

Hi,

  Is there a way to get C::B to save its config files (.workspace, .layout, .cbp) using CRLF for line breaks and not LF?

Thanks,
Adi

Teybeo

#1
This topic is near exactly 2 years old but I would like to have this feature too.
Git always complains that the .cbp file is LF ending and that it will have to convert it internally to CR-LF (along with the .layout and .workspace but I don't track them).
I think I could do something with the "auto-crlf" configuration in Git but changing the Codeblocks way of encoding its projects files seems easy... maybe it isn't ?

Using 8024 on Win7 64bits

stahta01

Quote from: Teybeo on July 02, 2012, 04:17:27 PM
This topic is near exactly 2 years old but I would like to have this feature too.
Git always complains that the .cbp file is LF ending and that it will have to convert it internally to CR-LF (along with the .layout and .workspace but I don't track them).
I think I could do something with the "auto-crlf" configuration in Git but changing the Codeblocks way of encoding its projects files seems easy... maybe it isn't ?

Using 8059 on Win7 64bits

Fix your GIT Settings; I have never used GIT; but, Google gives directions.

https://help.github.com/articles/dealing-with-line-endings

Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

Teybeo

That's what I did but really I don't understand what's happening. It's said that Git use LF internally so why would it have to do any conversion to a LF file ?
My autocrlf option is set to "true", which means "that Git will process all text files and make sure that CRLF is replaced with LF when writing that file to the object database and turn all LF back into CRLF when writing out into the working directory. This is the recommended setting on Windows because it ensures that your repository can be used on other platforms while retaining CRLF in your working directory."

Anyway I just added "*.cbp eol=lf" in the global .gitattributes file and the warning doesn't appears anymore.

In the end, is there a good reason for Codeblocks to have only LF in the projects files ? It could avoid having to deal with these stupids LF/CRLF problems at least on Windows

ollydbg

If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.