[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[jgit-dev] RevWalk not include all commits in left-right mode
|
During testing performance of new egit change set implementation I
discovered that RevWalk in left-right mode returns only 14592 commits
between linux kernel v2.6.36 and v2.6.38-rc2 when
git log --oneline v2.6.36..v2.6.38-rc2 | wc -l
returns 20693. It seams that RevWalk jumps directly to commit
f6f94e2 Linux 2.6.36
from commit
d25e6b0 Merge branch 'x86/cleanups' into x86/trampoline
skipping 6101 commits.
Maybe I'm doing something wrong ? Or I'm missing something here?
Here is my testing code:
FileRepository repo = new FileRepository("/patch/to/linux-2.6/.git");
ObjectId head = repo.resolve("v2.6.36");
ObjectId tag = repo.resolve("v2.6.38-rc2");
RevWalk rw = new RevWalk(repo);
RevCommit src = rw.parseCommit(tag);
RevCommit dst = rw.parseCommit(head);
RevFlag local = rw.newFlag("local");
src.add(local);
RevFlag remote = rw.newFlag("remote");
dst.add(remote);
RevFlagSet allFlags = new RevFlagSet(Arrays.asList(local, remote));
rw.carry(allFlags);
rw.markStart(src);
rw.markStart(dst);
int i = 0;
for (RevCommit commit : rw) {
if (commit.hasAll(allFlags))
break;
i++;
}
System.out.println("Number of retrieved commits: " + i);
--
Best regards
GSM: +48 695 192 160
Blog: http://luksza.org
LinkedIn: http://www.linkedin.com/in/dariuszluksza