我想让
我试着调整
我的
git diff
为除*.tex文件外的所有文件输出常规差异。对于*.tex文件,我希望看到git diff --word-diff
的输出。我试着调整
.gitattributes
和.gitconfig
,但最远只能得到一个.tex文件的部分显示,然后就崩溃了。这种行为可能吗?我的
.gitattributes
:*.tex diff=latex
.gitconfig
:
[diff "latex"]
wordRegex = "\\\\[a-zA-Z]+|[{}]|\\\\.|[^\\{}[:space:]]+"
command = ~/bin/word-diff.sh
以及 word-diff.sh
:
#!/bin/sh
git --no-pager diff --color-words "$2" "$5"