Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » JGit in-core Merging
JGit in-core Merging [message #815574] Wed, 07 March 2012 20:42 Go to next message
John Eblen is currently offline John EblenFriend
Messages: 1
Registered: March 2012
Junior Member
It seems that the main JGit merge API (the MergeCommand class) does not provide a way to do in-core merging. It looks like it is supported, however, because there are interfaces in the source for creating in-core mergers. So I have two questions:

1) Does in-core merging work reliably or is this a feature that hasn't been fully implemented yet?

2) If it does work reliably, what is the recommended or simplest way to use this feature? Sample source code would be helpful.

Re: JGit in-core Merging [message #816821 is a reply to message #815574] Fri, 09 March 2012 09:51 Go to previous message
Christian Halstrick is currently offline Christian HalstrickFriend
Messages: 252
Registered: July 2009
Senior Member
1) It works reliable and is used by tools like gerrit

2) Some explanation:
The API in org.eclipse.jgit.api should expose what people know from native gits porcelain API. The names of the commands, options and so on should be the same as in native git so that developers who how to do something on the command line find fast how they do it with JGit.

Since native git merge doesn't expose "in-core" it's not in the MergeCommand.

But: this package is also meant that developers find out how to do things with JGit and find code examples there. If options are not exposed or if the org.eclipse.jgit.api is not efficient enough for your use case you can use the more low level API's. Very often you can write much faster and less resource consuming code when you don't use org.eclipse.jgit.api.

If you look at you see how we construct mergers. If in this call you add a second parameter true you'll get a incore merger. You have two chances. Copy the code to your app and create a incore merger as explained. Or propose a new option to the MergeCommand.

Previous Topic:EGit doesn't attach itself to projects in the Resource Explorer
Next Topic: core.autocrlf now supported in egit/jgit?
Goto Forum:

Current Time: Fri Jun 22 02:09:21 GMT 2018

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

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

Back to the top