User forums > Using Code::Blocks

LF and CRLF in C::B files

(1/1)

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:
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

--- End quote ---

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

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

Tim S.

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:
FYI:
The reason is here: Re: Issue about saving the cbp project file, I think it should be fixed. :)

Navigation

[0] Message Index

Go to full version