git では.gitattributes
、.odt ファイル、libreofice ライター ファイルを difftool と比較するために使用しようとしています。このガイドに従うことから: http://www-verimag.imag.fr/~moy/opendocument/私はこれで.gitattributes
ファイル .gitattributes を作りました:
*.ods diff=odf
*.odt diff=odf
*.odp diff=odf
*.ods difftool=odf
*.odt difftool=odf
*.odp difftool=odf
これにより、git diff が .odt のテキストを比較するようになりましたが、git difftool が kdiff3 を起動して .odt ファイルを比較すると、次のポップアップ エラーが発生します。
Some input characters could not be converted to valid unicode.
You might be using the wrong codec. (e.g. UTF-8 for non UTF-8 files).
Don't save the result if unsure. Continue at your own risk.
Affected input files are in A, B.
...そして、ファイル内のすべての文字は巨大ジャンボです。
何が悪かったのか?これを修正するにはどうすればよいですか?
PS:
これが重要かどうかはわかりませんが、コマンドを実行するたびに「diff.tool」を構成していないと思います。
$ git difftool
私はこの出力を得る:
This message is displayed because 'diff.tool' is not configured.
See 'git difftool --tool-help' or 'git help config' for more details.
'git difftool' will now attempt to use one of the following tools:
opendiff kdiff3 tkdiff xxdiff meld kompare gvimdiff diffuse diffmerge ecmerge p4merge araxis bc codecompare emerge vimdiff
Viewing (1/1): 'diffexperiment.odt'
Launch 'kdiff3' [Y/n]:
それが、kdiff3 が odt2txt で動作しないように見える理由でしょうか?
編集: Microsoft Word 文書でこれを再試行し、ここでもう少し進めました。
.kdiff3rc 構成をいじってみました...追加したオプションのどれも、読み取り不能な文字を読み取り可能にするようには見えませんでした。比較ツールを vimdiff に変更しました。また、Microsoft Word ドキュメントで git difftool を実行すると、vimdiff は、判読できない文字ではなく、.xml で終わるファイルのリストを表示しました。
ファイルの 1 つで Enter キーを押すと、次のように表示されます。
<?xml version="1.0" encoding="UTF-8"?>
" Browsing zipfile /tmp/4LMJbj_HI I am writing something here..docx |<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Override PartName
" Select a file with cursor and press ENTER |="/_rels/.rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/><Overr
|ide PartName="/word/settings.xml" ContentType="application/vnd.openxmlformats-officedocument.w
_rels/.rels |ordprocessingml.settings+xml"/><Override PartName="/word/_rels/document.xml.rels" ContentType=
word/settings.xml |"application/vnd.openxmlformats-package.relationships+xml"/><Override PartName="/word/fontTabl
word/_rels/document.xml.rels |e.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+x
word/fontTable.xml |ml"/><Override PartName="/word/styles.xml" ContentType="application/vnd.openxmlformats-officed
word/numbering.xml |ocument.wordprocessingml.styles+xml"/><Override PartName="/word/document.xml" ContentType="app
word/styles.xml |lication/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml"/><Override Part
word/document.xml |Name="/docProps/app.xml" ContentType="application/vnd.openxmlformats-officedocument.extended-p
docProps/app.xml |roperties+xml"/><Override PartName="/docProps/core.xml" ContentType="application/vnd.openxmlfo
docProps/core.xml |rmats-package.core-properties+xml"/>
[Content_Types].xml |</Types>
この問題に関する新しい質問をここに投稿しました。