Hi, all.
I found that jgit-log produces incorrect logs under certain conditions. I made a test case and push it into my github repository so you can easily reproduce that as below. In this case, a.txt and b.txt were added in foo/bar directory but "jgit log -- foo/bar" doesn't show the commit adding a.txt:
$ cd jgit-log-bug
$ git log -- foo/bar
commit 57df1bbaaf1e6d52d314c3a9852bddb1d1a3f7b4
Date: Fri Feb 28 21:54:15 2014 +0900
Add b.txt
commit c6eb4890b2f26777d8b38fb948c42a426a6bebf6
Date: Fri Feb 28 21:53:23 2014 +0900
Add a.txt
$ jgit log -- foo/bar
commit 57df1bbaaf1e6d52d314c3a9852bddb1d1a3f7b4
Date: Fri Feb 28 21:54:15 2014 +0900
Add b.txt
commit 26df225de7f33fdea9b58d70723b78b91f843ead
Date: Fri Feb 28 21:53:59 2014 +0900
Merge branch 'test'
And also I found it works correctly when I removed these lines in org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RewriteTreeFilter.java:
if (chgs[i] == adds[i]) {
// All of the differences from this parent were because we
// added files that they did not have. This parent is our
// "empty tree root" and thus their history is not relevant.
// Cut our grandparents to be an empty list.
//
pList[i].parents = RevCommit.NO_PARENTS;
}
I tested this with jgit in master branch(83c743e6e246a751675728d29a627a98475d72d6).
Thanks for reading.
Best Regards,
EungJun Yi