ted y skrev 2012-03-25 07.43:
> I followed www.andymcintosh.com/?p=33
>
> and in commandline, when I do
> git mergetool --tool=p4merge
>
> it does work,
>
> but in EGit + eclipse, selecting the "Team"-->"merge tool" option still fires up the default 3-way merge tool, not p4merge, which has a much nicer UI and seems to have a
> better merging algorithm.
>
> is it possible to use p4merge inside Egit?

Currently, no.

I've looked at the API:s and it seem possible to do it, but is seems nobody has
done it yet. There are a number for external compare plugins out there, but
nobody, AFAIK, does in a general way enough to work with any team provider.

This is a good use-case for an external launcher work-around. These are very effective for any operations not yet supported by egit that don't require per-invocation arguments. I use them for the the core svn bridging operations ('svn fetch', 'svn dcommit', 'svn rebase'), the missing stash operations ('drop', 'pop', 'clear') and misc things like 'gc'. If you create a String Substitution variable for the the location of the Git installation, you can share them as part of your repository. The predefined egit variables like git_work_tree are useful here.

External option sounds great. Here is a MS Windows working .gitconfig for quite a few diff/merge tools, except emerge, kompare, vimdiff. Any suggestions how to proceed?

Proceed with an external launcher you mean? That's pretty easy:

As a preliminary I recommend defining a String Substitution variable called 'git_exec', where the value is the path you your Git executable. This will allow you to share the launcher by saving it as a part of the repository without making any assumptions about where each developer has command-line Git installed. Do this in Preferences -> Run/Debug/String Substitution.

5) For the Arguments, provide the Git command-line argument(s), eg 'difftool' (without the quotes of course)

6) For the Name use whatever you like, eg Git difftool

7) To share this launcher, click the 'Common' tab, then the 'Shared FIle' radio button. For the value choose any directory you like in your project, or make a new one and use that. The new launcher will now show up as an untracked file. To share just add, commit and push as usual.

There are sone other options in the external launchers that can be used to optimize the behavior a little. For example, if you don't need to build the project before launching (as you wouldn't for difftool), you can turn that off in the 'Build' tab. Similarly, if you don't need to refresh the workspace after the launcher completes, you can disable that in the 'Refresh' tab.