我嘗試了使用原來的問題第一個評論,我想與大家分享我的測試結果。
如果保存的OpenOffice文檔作爲「平XML」你可以在Git中使用的diffable文件格式。 儘管這樣做還不夠完美,因爲有一些開銷不是'內容',而是像時間戳,視口信息和可見按鈕或其狀態之類的配置信息。 大部分來自這也進入提交。 這是將一個段落到一個空文件的DIFF:
diff --git a/Test2.fodt b/Test2.fodt
index 02a528a..bec4f67 100644
--- a/Test2.fodt
+++ b/Test2.fodt
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<office:document xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:rpt="http://openoffice.org/2005/report" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:grddl="http://www.w3.org/2003/g/data-view#" xmlns:officeooo="http://openoffice.org/2009/office" xmlns:tableooo="http://openoffice.org/2009/table" xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0" xmlns:css3t="http://www.w3.org/TR/css3-text/" office:version="1.2" office:mimetype="application/vnd.oasis.opendocument.text">
- <office:meta><meta:creation-date>2013-02-26T08:36:00</meta:creation-date><meta:generator>LibreOffice/3.6$Linux_x86 LibreOffice_project/360m1$Build-2</meta:generator><meta:document-statistic meta:table-count="0" meta:image-count="0" meta:object-count="0" meta:page-count="1" meta:paragraph-count="0" meta:word-count="0" meta:character-count="0" meta:non-whitespace-character-count="0"/></office:meta>
+ <office:meta><meta:creation-date>2013-02-26T08:36:00</meta:creation-date><meta:generator>LibreOffice/3.6$Linux_x86 LibreOffice_project/360m1$Build-2</meta:generator><meta:document-statistic meta:table-count="0" meta:image-count="0" meta:object-count="0" meta:page-count="1" meta:paragraph-count="1" meta:word-count="2" meta:character-count="13" meta:non-whitespace-character-count="12"/><dc:date>2013-02-26T08:37:13</dc:date><meta:editing-duration>P0D</meta:editing-duration><meta:editing-cycles>1</meta:editing-cycles></office:meta>
<office:settings>
<config:config-item-set config:name="ooo:view-settings">
<config:config-item config:name="ViewAreaTop" config:type="int">0</config:config-item>
@@ -14,7 +14,7 @@
<config:config-item-map-entry>
<config:config-item config:name="ViewId" config:type="string">view2</config:config-item>
<config:config-item config:name="ViewLeft" config:type="int">6158</config:config-item>
- <config:config-item config:name="ViewTop" config:type="int">2501</config:config-item>
+ <config:config-item config:name="ViewTop" config:type="int">2988</config:config-item>
<config:config-item config:name="VisibleLeft" config:type="int">0</config:config-item>
<config:config-item config:name="VisibleTop" config:type="int">0</config:config-item>
<config:config-item config:name="VisibleRight" config:type="int">29314</config:config-item>
@@ -205,6 +205,12 @@
<text:linenumbering-configuration text:number-lines="false" text:offset="0.499cm" style:num-format="1" text:number-position="left" text:increment="5"/>
</office:styles>
<office:automatic-styles>
+ <style:style style:name="P1" style:family="paragraph" style:parent-style-name="Standard">
+ <style:text-properties officeooo:paragraph-rsid="0004a3d7"/>
+ </style:style>
+ <style:style style:name="T1" style:family="text">
+ <style:text-properties officeooo:rsid="0004a3d7"/>
+ </style:style>
<style:page-layout style:name="pm1">
<style:page-layout-properties fo:page-width="21.001cm" fo:page-height="29.7cm" style:num-format="1" style:print-orientation="portrait" fo:margin="2cm" fo:margin-top="2cm" fo:margin-bottom="2cm" fo:margin-left="2cm" fo:margin-right="2cm" style:writing-mode="lr-tb" style:footnote-max-height="0cm">
<style:footnote-sep style:width="0.018cm" style:distance-before-sep="0.101cm" style:distance-after-sep="0.101cm" style:line-style="solid" style:adjustment="left" style:rel-width="25%" style:color="#000000"/>
@@ -224,7 +230,8 @@
<text:sequence-decl text:display-outline-level="0" text:name="Text"/>
<text:sequence-decl text:display-outline-level="0" text:name="Drawing"/>
</text:sequence-decls>
- <text:p text:style-name="Standard"/>
+ <text:p text:style-name="P1"><text:span text:style-name="T1">One paragraph</text:span></text:p>
+ <text:p text:style-name="P1"><text:span text:style-name="T1"/></text:p>
</office:text>
</office:body>
</office:document>
\ No newline at end of file
FWIW,最近打開/ LibreOffice的版本允許保存到這是進行版本基於文本的XML-ISH格式('.fodt'你的情況) 。這些文件往往比較大,但我在'git'中跟蹤這些文件的成功率很高。當然,我沒有必要嘗試合併它們(我的電子表格往往比我的實際代碼項目更具線性歷史記錄) - 不確定這是否正常工作。 – twalberg 2013-02-25 15:57:02
感謝您的信息。我不知道,但我會用臨時回購做一些實驗。也許這也適用。很高興有提交顯示從OOo到LaTeX的變化... – 2013-02-25 16:06:23