如何retrieve symmetric difference登录JGit?基本上,等同于下一个git命令:
git log br-1...br-2
它检索从一次提交可以访问的提交,但是无法从两次提交中访问。
下一个代码对我有用,但可能还有更好的方法:
ObjectId br1 = repository.resolve("br-1");
ObjectId master = repository.resolve("master");
RevWalk walk = new RevWalk(repository);
walk.setRevFilter(RevFilter.MERGE_BASE);
walk.markStart(walk.parseCommit(br1));
walk.markStart(walk.parseCommit(master));
RevCommit base = walk.next();
Iterable<RevCommit> logs = git.log()
.add(br1)
.add(master)
.not(base)
.call();