git/list[1] front-page[2] threads[3] people[4] search[5] about
 

RE: jgit merge question

From
DBDavid Birchfield <dbirchfield@asu.edu>
Date
Jan 14, 2009, 22:03 UTC
Message-ID
<AB447EEF7BAAB7489B29A4F3F788D02C01CDD792@EX07.asurite.ad.asu.edu>
In-Reply-To
<20090114153034.GZ10179@spearce.org>
Great - thanks so much for this feedback and link.  My merge needs are straightforward, so hopefully this will suit the need!
I have pulled the latest jgit updates and downloaded the four .java files that are referenced in your link.  I have added these to the directory structure for jgit in the following new folder: org.spearce.jgit/src/org/spearce/jgit/merge/
However, when I try to now make_jgit.sh I am getting a series of errors (pasted below) that appear to stem from not having the same underlying files.  Is it possible that I am not getting the most recent jgit release files?  Or am I misunderstanding how you expect these Merge files to be used?

Thanks again, David

<errors>
Entering org.spearce.jgit ...
./org/spearce/jgit/merge/StrategySimpleTwoWayInCore.java:45: cannot find symbol
symbol  : class UnmergedPathException
location: package org.spearce.jgit.errors
import org.spearce.jgit.errors.UnmergedPathException;
                               ^
./org/spearce/jgit/merge/Merger.java:184: cannot find symbol
symbol  : constructor CanonicalTreeParser(<nulltype>,org.spearce.jgit.lib.Repository,org.spearce.jgit.revwalk.RevTree,org.spearce.jgit.lib.WindowCursor)
location: class org.spearce.jgit.treewalk.CanonicalTreeParser
			return new CanonicalTreeParser(null, db, base.getTree(), curs);
                               ^
./org/spearce/jgit/merge/StrategySimpleTwoWayInCore.java:98: cannot find symbol
symbol  : method newInCore()
location: class org.spearce.jgit.dircache.DirCache
			cache = DirCache.newInCore();
                                        ^
./org/spearce/jgit/merge/StrategySimpleTwoWayInCore.java:123: cannot find symbol
symbol  : variable STAGE_0
location: class org.spearce.jgit.dircache.DirCacheEntry
					add(T_THEIRS, DirCacheEntry.STAGE_0);
                                                                   ^
./org/spearce/jgit/merge/StrategySimpleTwoWayInCore.java:125: cannot find symbol
symbol  : variable STAGE_0
location: class org.spearce.jgit.dircache.DirCacheEntry
					add(T_OURS, DirCacheEntry.STAGE_0);
                                                                 ^
./org/spearce/jgit/merge/StrategySimpleTwoWayInCore.java:137: cannot find symbol
symbol  : method writeTree(org.spearce.jgit.lib.ObjectWriter)
location: class org.spearce.jgit.dircache.DirCache
				resultTree = cache.writeTree(getObjectWriter());
                                                  ^
./org/spearce/jgit/merge/StrategySimpleTwoWayInCore.java:139: cannot find symbol
symbol  : class UnmergedPathException
location: class org.spearce.jgit.merge.StrategySimpleTwoWayInCore.InCoreMerger
			} catch (UnmergedPathException upe) {
                                 ^
./org/spearce/jgit/merge/StrategySimpleTwoWayInCore.java:147: cannot find symbol
symbol  : method getRawPath()
location: class org.spearce.jgit.treewalk.NameConflictTreeWalk
				builder.addTree(tw.getRawPath(), db, tw.getObjectId(1));
                                                  ^
./org/spearce/jgit/merge/StrategySimpleTwoWayInCore.java:149: cannot find symbol
symbol  : variable STAGE_0
location: class org.spearce.jgit.dircache.DirCacheEntry
				add(T_OURS, DirCacheEntry.STAGE_0);
                                                         ^
./org/spearce/jgit/merge/StrategySimpleTwoWayInCore.java:153: cannot find symbol
symbol  : variable STAGE_1
location: class org.spearce.jgit.dircache.DirCacheEntry
			add(T_BASE, DirCacheEntry.STAGE_1);
                                                 ^
./org/spearce/jgit/merge/StrategySimpleTwoWayInCore.java:154: cannot find symbol
symbol  : variable STAGE_2
location: class org.spearce.jgit.dircache.DirCacheEntry
			add(T_OURS, DirCacheEntry.STAGE_2);
                                                 ^
./org/spearce/jgit/merge/StrategySimpleTwoWayInCore.java:155: cannot find symbol
symbol  : variable STAGE_3
location: class org.spearce.jgit.dircache.DirCacheEntry
			add(T_THEIRS, DirCacheEntry.STAGE_3);
                                                   ^
./org/spearce/jgit/merge/StrategySimpleTwoWayInCore.java:163: cannot find symbol
symbol  : method getRawPath()
location: class org.spearce.jgit.treewalk.NameConflictTreeWalk
				e = new DirCacheEntry(tw.getRawPath(), stage);
                                                        ^
./org/spearce/jgit/merge/StrategySimpleTwoWayInCore.java:163: internal error; cannot instantiate org.spearce.jgit.dircache.DirCacheEntry.<init> at org.spearce.jgit.dircache.DirCacheEntry to ()
				e = new DirCacheEntry(tw.getRawPath(), stage);
                                    ^
</errors
-----Original Message-----

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
Previous: Shawn O. PearceNext: Shawn O. Pearce
Message 4 of 7 in “jgit merge question”
  1. David BirchfieldJan 14, 2009
  2. Johannes SchindelinJan 14, 2009
  3. Shawn O. PearceJan 14, 2009
  4. David BirchfieldJan 14, 2009
  5. Shawn O. PearceJan 14, 2009
  6. David BirchfieldJan 15, 2009
  7. Shawn O. PearceJan 15, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.