{"thread":{"id":"19941","subject":"Choosing a mergetool according to file type","startedAt":"2009-06-26T10:28:11Z","lastAt":"2009-06-26T10:28:11Z","messageCount":1,"participants":["Gregory Jefferis"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"117010","messageId":"C66A614B.205E4%jefferis@gmail.com","threadId":"19941","inReplyTo":null,"subject":"Choosing a mergetool according to file type","fromName":"Gregory Jefferis","fromEmail":"jefferis@gmail.com","sentAt":"2009-06-26T10:28:11Z","receivedAt":"2009-06-26T10:28:11Z","isPatch":false,"sender":{"key":"jefferis@gmail.com","avatar":"https://gravatar.com/avatar/8528f4e227ebc88380c203c816e263246064e31f6180681dc2c6dabfaff24d6b?d=mp&s=160"},"body":"Dear all, \n\nIs there a way to specify which mergetool is called for different files in a\nrepository in the same way that one can specify a diff tool using\n.gitattributes?  I would like to use a custom mergetool for certain binary\nfile types (MS Word dare I say it) but stick with my standard tool\n(FileMerge.app) for regular files.\n\nI have set up custom mergetool and diff commands in .git/config:\n\n[mergetool \"wordmergetool\"]\n   path = /Users/jefferis/bin/\n   cmd = wordgitmerge \"$PWD/$REMOTE\" \"$PWD/$BASE\" \"$PWD/$LOCAL\"\n\"$PWD/$MERGED\"\n[diff \"wordgitdiff\"]\n   command = wordgitdiff\n\n# adding the following to gitattributes handles the diff case\n*.doc diff=wordgitdiff\n\n# but of course this doesn't alter the mergetool that is called.\n*.doc mergetool= wordmergetool\n\nMany thanks for any suggestions,\n\nGreg.\n\ngit version 1.6.3.2.202.g26c11\nMacOS X 10.5.7\n\n-- \nGregory Jefferis, PhD\nDivision of Neurobiology\nMRC Laboratory of Molecular Biology,\nHills Road,        \nCambridge, CB2 0QH, UK.\n\nhttp://www2.mrc-lmb.cam.ac.uk/NB/jefferis_g\nhttp://www.neuroscience.cam.ac.uk/directory/profile.php?gsxej2\nhttp://flybrain.stanford.edu\n"}]}