Choosing a mergetool according to file type

From: Gregory Jefferis <hidden>
Date: 2016-06-15 22:46:59

Dear all, 

Is there a way to specify which mergetool is called for different files in a
repository in the same way that one can specify a diff tool using
.gitattributes?  I would like to use a custom mergetool for certain binary
file types (MS Word dare I say it) but stick with my standard tool
(FileMerge.app) for regular files.

I have set up custom mergetool and diff commands in .git/config:

[mergetool "wordmergetool"]
   path = /Users/jefferis/bin/
   cmd = wordgitmerge "$PWD/$REMOTE" "$PWD/$BASE" "$PWD/$LOCAL"
"$PWD/$MERGED"
[diff "wordgitdiff"]
   command = wordgitdiff

# adding the following to gitattributes handles the diff case
*.doc diff=wordgitdiff

# but of course this doesn't alter the mergetool that is called.
*.doc mergetool= wordmergetool

Many thanks for any suggestions,

Greg.

git version 1.6.3.2.202.g26c11
MacOS X 10.5.7

-- 
Gregory Jefferis, PhD
Division of Neurobiology
MRC Laboratory of Molecular Biology,
Hills Road,        
Cambridge, CB2 0QH, UK.

http://www2.mrc-lmb.cam.ac.uk/NB/jefferis_g
http://www.neuroscience.cam.ac.uk/directory/profile.php?gsxej2
http://flybrain.stanford.edu
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help