Hello!

Some time has passed since my last blog post, and I want to bring to your attention an interesting feature of git, introduced in the 1.6.1 version, according to the Release Notes (I quote here the relevant part):

* “git diff” learned “textconv” filters — a binary or hard-to-read

contents can be munged into human readable form and the difference

between the results of the conversion can be viewed (obviously this

cannot produce a patch that can be applied, so this is disabled in

format-patch among other things).

So we can use this feature to make git diff various filetypes according to the text content. For example, we can tell to git to use a software like odt2txt (that converts an OpenDocument file in a simple text file, with obviously minimal formatting), by adding something like:



[diff "odf"]

textconv=odt2txt



to the file ~/.gitconfig .

Now what we have to do is to add:



*.ods diff=odf

*.odt diff=odf

*.odp diff=odf



to the file .gitattributes or $GIT_DIR/info/attributes .

That’s all! 🙂