Thread (7 messages) flat view 7 messages, 3 authors, 2016-06-15

Re: jgit merge question

From: Shawn O. Pearce <hidden>
Date: 2016-06-15 22:45:57

Johannes Schindelin [off-list ref] wrote:
On Wed, 14 Jan 2009, David Birchfield wrote:
quoted
I have been working with the JGit library and with the pgm files and 
other documentation I have been able to implement most of the basic 
functions that I need for my testing application - including fetch.  
This is great!
I'm glad JGit has been useful for you.
quoted
However, I have not been able to successfully implement 
the merge function with JGit. There is some reference to this in the 
mail archive, but I cannot find any of the merge code that is referenced 
in the distribution.
David is probably talking about the 8 patch series I proposed to add a
crude merge API to JGit.  The patches are available here, based on the
current JGit master:

  http://android.git.kernel.org/?p=tools/egit.git;a=shortlog;h=refs/heads/for-gerrit2
  git://android.git.kernel.org/tools/egit.git for-gerrit2

as I'm still highly dependent upon this in Gerrit2, but I haven't
been able to fix enough bugs and add enough unit tests to make
Robin happy with accepting them into the library.  I plan to get
back to that as soon as Gerrit2 is live for Android.

That API is a very, very crude merge API.  I don't like coding
with it from the application level.  It doesn't give Gerrit2
enough error information when it fails, and that means any other
application will also be unhappy with it.

It also has at least one bug, but at least its a conservative bug
(it won't merge subtrees sometimes and aborts even though they
should have merged clean).  Its also missing a huge block of code
about head simplification; that block is in Gerrit2 application
code rather than down in the library (that was a mistake in design).

So basically, yea, I've proposed something, but there are some very
good reasons why there isn't merge support yet in JGit.
http://thread.gmane.org/gmane.comp.version-control.git/100524/focus=100589
Yea, we also need the diff implementation so we can do file-level
merges.  That merge API above only does path-level merges.  If a
file is modified on both sides, the merge API I use in Gerrit2
just aborts.  That typically isn't what a human who is trying to
use Git for development wants.
 
Yes, it has not been implemented, basically because it needs a diff 
implementation, and I constantly run out of time working on it.  I have 
something that works, but needs lots of improvements to be usable 
(basically, it has to avoid deep recursion depths).
What's a little stack space between friends?  ;-)

-- 
Shawn.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help