Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » Egit + p4merge ?
Egit + p4merge ? [message #828673] Sun, 25 March 2012 05:43 Go to next message
ted y is currently offline ted yFriend
Messages: 9
Registered: March 2012
Junior Member
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?

Thanks
Yang
Re: Egit + p4merge ? [message #828806 is a reply to message #828673] Sun, 25 March 2012 10:11 Go to previous messageGo to next message
Robin Rosenberg is currently offline Robin RosenbergFriend
Messages: 332
Registered: July 2009
Senior Member
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.

You could invoke git mergetool from the External Tools menu.

-- robin
Re: Egit + p4merge ? [message #829536 is a reply to message #828806] Mon, 26 March 2012 12:26 Go to previous messageGo to next message
R Shapiro is currently offline R ShapiroFriend
Messages: 386
Registered: June 2011
Senior Member
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.
Re: Egit + p4merge ? [message #848213 is a reply to message #828673] Wed, 18 April 2012 03:01 Go to previous messageGo to next message
Ma Thomas is currently offline Ma ThomasFriend
Messages: 1
Registered: April 2012
Junior Member
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?


#
#
[user]
email = yourname@gmail.com
name = yourname
#
# git difftool -t bc3
# git difftool -t diffmerge
# git difftool -t ecmerge
# git difftool -t kdiff3
# git difftool -t p4merge
# git difftool -t windiff
# git difftool -t winmerge
#
[diff]
tool = p4merge
#tool = bc3
#tool = diffmerge
#tool = ecmerge
#tool = kdiff3
#tool = p4merge
#tool = windiff
#tool = winmerge
#tool = emerge
#tool = kompare
#tool = vimdiff
#

[difftool "bc3"]
path = "c:/lang/tools/diff_merge/bc3/bcomp.exe"
#

[difftool "diffmerge"]
cmd = "\"c:/lang/tools/diff_merge/diffmerge/sgdm.exe\" \"$LOCAL\" \"$REMOTE\""
#cmd = "sgdm.exe \"$LOCAL\" \"$REMOTE\""
#

[difftool "ecmerge"]
path = "c:/lang/tools/diff_merge/ecmerge/ecmerge.exe"
#

[difftool "kdiff3"]
path = "c:/lang/tools/diff_merge/KDiff3/kdiff3.exe"
#

[difftool "p4merge"]
path = "c:/lang/tools/diff_merge/perforce/p4merge.exe"
#

[difftool "windiff"]
cmd = "\"c:/lang/tools/diff_merge/windiff/windiff.exe\" \"$LOCAL\" \"$REMOTE\""
#cmd = "windiff.exe \"$LOCAL\" \"$REMOTE\""
#

[difftool "winmerge"]
cmd = "\"c:/lang/tools/diff_merge/winmerge/winmergeu.exe\" \"$LOCAL\" \"$REMOTE\""
#cmd = "winmergeu.exe \"$LOCAL\" \"$REMOTE\""
#

[difftool]
#prompt = false

#
# git mergetool -t bc3
# git mergetool -t diffmerge
# git mergetool -t ecmerge
# git mergetool -t kdiff3
# git mergetool -t p4merge
# git mergetool -t winmerge
#
[merge]
tool = p4merge
#tool = bc3
#tool = diffmerge
#tool = ecmerge
#tool = kdiff3
#tool = p4merge
#tool = winmerge
#tool = emerge
#tool = kompare
#tool = vimdiff
#

[mergetool "bc3"]
path = "c:/lang/tools/diff_merge/bc3/bcomp.exe"
#trustExitCode = true
#

[mergetool "diffmerge"]
cmd = "\"c:/lang/tools/diff_merge/diffmerge/sgdm.exe\" --merge --result=\"$MERGED\" \"$LOCAL\" \"$BASE\" \"$REMOTE\""
#cmd = "sgdm.exe --merge --result=\"$MERGED\" \"$LOCAL\" \"$BASE\" \"$REMOTE\""
#trustExitCode = true
#

[mergetool "ecmerge"]
path = "c:/lang/tools/diff_merge/ecmerge/ecmerge.exe"
#trustExitCode = true
#

[mergetool "kdiff3"]
path = "c:/lang/tools/diff_merge/KDiff3/kdiff3.exe"
#trustExitCode = true
#

[mergetool "p4merge"]
path = "c:/lang/tools/diff_merge/perforce/p4merge.exe"
#trustExitCode = true
#

[mergetool "winmerge"]
cmd = "\"c:/lang/tools/diff_merge/winmerge/winmergeu.exe\" --merge --result=\"$MERGED\" \"$LOCAL\" \"$BASE\" \"$REMOTE\""
#cmd = "winmergeu.exe --merge --result=\"$MERGED\" \"$LOCAL\" \"$BASE\" \"$REMOTE\""
#trustExitCode = true
#

[mergetool]
keepBackup = false


Re: Egit + p4merge ? [message #848716 is a reply to message #848213] Wed, 18 April 2012 14:06 Go to previous message
R Shapiro is currently offline R ShapiroFriend
Messages: 386
Registered: June 2011
Senior Member
Ma Thomas wrote on Tue, 17 April 2012 23:01
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.

To make a launcher:

1) Open "External Tools Configuration..." from the External Tools toolbar item

2) Click the "New Launch configuration"

3) For the Location value use ${git_exec}

4) for the Working Directory use ${git_work_tree}

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.


Previous Topic:Quick diff bug?
Next Topic:Team Synchronize doesn't work anymore
Goto Forum:
  


Current Time: Tue Apr 23 14:47:35 GMT 2024

Powered by FUDForum. Page generated in 0.03193 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top