Control over OS line breaks

Is there a way to control which line break format libreOffice writer will use?

I have a collection of odt files that are managed in a git versioning repository. I love working with odt because most text changes are very clear on git’s textual diff display.

One (small) problem I am having is that I have those files edited on LibreOffice running on several platforms, and libreoffice saves the linebreaks in the text portion of the odt file in using the OS’ preference for line break. It’s not really a problem as it only impacts the diff display (e.g. it shows ^M when a linux file is later edited in windows) and we do not plan to manipulate those odt files outside of libreoffice (though it would be nice to know the lines breaks will not cause problem we decide to use other tools on them).

Ideally i’d like to have all platforms using UNIX line breaks.

edit:

here’s a preview what I get for git diff file.odt

diff --git a/file.odt b/file.odt
index f1033bb..12f130fa 100644
--- a/file.odt
+++ b/file.odt
@@ -1,50 +1,15 @@

 Context line. not changed. keep linux line breaks.
-- original line.
++ original line.^M
++ a new line added.^M

Line breaks in ODT visible in git? does git look inside ZIP?

I don’t really understand what you actually mean; and in my experience (and I use Windows mainly) LibreOffice uses LFs in ODTs regardless of platform - but what you write looks like a bug - which needs to be filed appropriately.

edited the question with an example.

It would be also interesting if you also attached the file.odt itself. Somehow I suspect that it’s not an ODT, but a plain text.

@gcbw: How do you manage to have git access the .odt content? From what I know, .odt files are zip archives and AFAIK gits sees them as binary, just noting that the mod times are different without going into more details.

Have you a specific git plugin? In which case, I’m very interested.

When unzipped, an .odt is a directory with several files and sub-directories. How is that handled by git?

Supposing you store your files as .fodt which is a text format, how do you filter the “technical” line wraps used to limit line length from the really significant content (whether it is XML seasoning or document discourse)? These line wraps may vary without the document semantics being changed and such “technical” adaptations should be ignored by the version system as not being the result of intentional user modification.

No plugins! though this is not compiled from source by me, so it might include plugins i don’t know about. i will double check. the example code is copy-paste from git-for-windows session (which i’m not in front-of right now). and indeed the file is a zip! but i do see the diff as text.