I previously had the following script in a file called .emacs.d/emerge-for-git:
#!/bin/sh
emacs -Q $*
And In my .gitconfig:
[merge]
tool = emerge
[mergetool "emerge"]
path = /home/rovanion/.emacs.d/emerge-for-git
But wishing to improve upon that so that it would connect to the already running emacsclient I ended up with the following lines:
#!/bin/sh
emacsclient -nw --eval "(emerge-files nil \"$3\" \"$4\" \"${4}.out\")""\")"
But that ended up saving the merged file to source/path/path
instead of source/path
. So to save myself some grey hairs, and posterity of course, I decided to ask you instead:
How do you hook up git to your emacsclient?