解压缩OpenOffice文件以在版本控制中更好地存储 [英] Uncompress OpenOffice files for better storage in version control

查看:170
本文介绍了解压缩OpenOffice文件以在版本控制中更好地存储的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我听说过有关如何将OpenOffice(ODF)文件转换为XML和其他数据的压缩zip文件的讨论.因此,对文件进行很小的更改可能会完全更改数据,因此增量压缩在版本控制系统中无法很好地发挥作用.

I've heard discussion about how OpenOffice (ODF) files are compressed zip files of XML and other data. So making a tiny change to the file can potentially totally change the data, so delta compression doesn't work well in version control systems.

我已经对OpenOffice文件进行了基本测试,将其解压缩,然后以零压缩率将其重新压缩.我使用Linux zip实用程序进行测试. OpenOffice仍然会很乐意打开它.

I've done basic testing on an OpenOffice file, unzipping it and then rezipping it with zero compression. I used the Linux zip utility for my testing. OpenOffice will still happily open it.

所以我想知道是否值得开发一个小的实用程序,以便在每次我提交版本控制之前就可以在ODF文件上运行.对这个想法有什么想法吗?可能有更好的替代方法?

So I'm wondering if it's worth developing a small utility to run on ODF files each time just before I commit to version control. Any thoughts on this idea? Possible better alternatives?

第二,什么是实现此小实用程序的好方法?调用zip的Bash外壳程序(可能仅适用于Linux)? Python?您能想到的任何陷阱吗?显然,我不想意外地处理文件,并且有几种可能的发生方式.

Secondly, what would be a good and robust way to implement this little utility? Bash shell that calls zip (probably Linux only)? Python? Any gotchas you can think of? Obviously I don't want to accidentally mangle a file, and there are several ways that could happen.

我能想到的可能陷阱:

  • 磁盘空间不足
  • 其他一些权限问题,导致无法写入文件或临时文件
  • ODF文档是经过加密的(可能应该将它们保留下来;加密可能还会导致文件大变化,从而阻止有效的增量压缩)

推荐答案

您可以考虑以FODT格式(平面XML格式)存储文档.
这是相对较新的替代解决方案.

You may consider to store documents in FODT-format - flat XML format.
This is relatively new alternative solution available.

文档只是解压缩存储.

更多信息,请访问 https://wiki.documentfoundation.org/Libreoffice_and_subversion .

这篇关于解压缩OpenOffice文件以在版本控制中更好地存储的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆