help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to configure git diff tool to use emacs diff tool


From: Andreas Politz
Subject: Re: How to configure git diff tool to use emacs diff tool
Date: Thu, 01 Oct 2009 09:10:09 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

n179911 <address@hidden> writes:


> On Wed, Sep 30, 2009 at 7:23 PM, Andreas Politz <address@hidden> wrote:
>> hap 497 <address@hidden> writes:
>>
>>> Hi,
>>>
>>> One can configure git merge tool to use vimdiff
>>>
>>> $git config --global merge.tool vimdiff
>>>
>>> How can I change it to use emacs diff? And is it possible to use
>>> emacsclient for diff?
>>> http://www.emacswiki.org/emacs/EmacsClient#toc1 (so that I can speed
>>> things up by not launching a new emacs every time).
>>>
>>> Thank you.
>>
>> It seems obvious, how to do this.  The emacs function is `ediff-files' and it
>> takes 2 arguments, namely the files to run diff on.  Combine this with
>> the --eval option of emacs(client) in a shell.
>>
>> $ cat ~/bin/ediff
>> #!/bin/sh
>>
>> emacsclient --eval "(ediff-files \"$1\" \"$2\")"
>>
>> -ap
>>
>>
>>
>>


> I tried you script. When I run it at command line with 2 different files:
>
> $ /Users/paul/bin/ediff.sh src/ComposeMessageActivity.java 
> src/NewActivity.java
>
> it works.
>
> But after i set that up to git merge.tool
> $ git config --global merge.tool /Users/paul/bin/ediff.sh
> $ git diff
> It does not invoke the ediff. It still uses the shell diff tool.
>
> Thank you for any idea.
>

Read the manual, especially `merge.tool' and `merge.<tool>.cmd'.  I
never used git-merge, so I don't know how this ought to behave.

-ap






reply via email to

[Prev in Thread] Current Thread [Next in Thread]