Thinker
Thinker

Reputation: 323

git configuration file for diffing docx

I wanted to be able to diff docx file and found that using the following code we are able to extract the text from docx files. unzip -p some.docx word/document.xml | sed -e 's/<[^>]\{1,\}>//g; s/[^[:print:]]\{1,\}//g' | fold -w 80

However, I am struggling to include this into the gitattribute file. Can someone comment on how this line needs to be modified so that git uses the current file instead of the hardlink to the docx file

I have tried the following in git config but it causes an error:

[diff "word"] textconv= unzip -p $LOCAL | sed -e 's/<[^>]\{1,\}>//g; s/[^[:print:]]\{1,\}//g' |

Upvotes: 0

Views: 1419

Answers (1)

rlegendi
rlegendi

Reputation: 10606

Here's a proper solution for that, simply stripping the strings, that might cause you some headache.

Upvotes: 1

Related Questions