Araxis Merge doesn't respect .gitattributes preferences

164 views Asked by At

I've added path/to/compiled/file.css -diff to my .gitattributes folder.

git diff --no-ext-diff respects the preference and just lets me know the binary file was changed, but git diff (configured to use Araxis Merge as a gui diff) does not. When Araxis hits the compiled css file, I get a spinning beachball.

Any ideas how to get Araxis to respect my wishes?

1

There are 1 answers

0
elmart On BEST ANSWER

Git communicates with the external tool by invoking the external tool command:

$command $LOCAL $REMOTE

So, even if git knows that it should not try computing a diff on a given file, it has no way to communicate that to the external tool.

The external tool can only guess which files are binary by looking at their extension, then. And, in this case, "css" is not going to be recognized as binary.

So, there's no way to signal the external tool to ignore a css file. What we would need, then, is a way to exclude the file from those passed to the external tool.

You can do that by setting a custom no-op diff driver:

$ git config diff.noop.command true      # if "true" is a bash builtin in your system
or
$ git config.diff.noop.command /bin/true # if "true" is a real binary in your system

And then setting that custom driver to be used with your file:

(at .gitattributes)
/path/to/compiled/file.css diff=noop

That should do it.