Community
Participate
Working Groups
Created attachment 287497 [details] the test repo ``` mkdir test-path-filter-repo cd test-path-filter-repo git init mkdir -p src/d1 touch src/d1/file1 git add * git commit -m "file1" git branch b1 touch src/d1/file2 git add * git commit -m "file2" git checkout b1 touch src/d1/file3 git add * git commit -m "file3" git checkout master git merge b1 ``` I used the above commands to create the test repository. In this test repository, the jgit result of git log - <path> is wrong. $ jgit log -- src/d1 commit 88c7262d9ea93b4f23b6970580908f99c09f10da Author: kylezhao <kylezhao@tencent.com> Date: Fri Nov 12 14:56:54 2021 +0800 Merge branch 'b1' commit 8af1b91e261dcb5b01f4c6efcd1435b661dc0e2e Author: kylezhao <kylezhao@tencent.com> Date: Fri Nov 12 14:56:54 2021 +0800 file2 commit 9a83592dd073777b7e813b5dbe89831df6c1ee45 Author: kylezhao <kylezhao@tencent.com> Date: Fri Nov 12 14:56:54 2021 +0800 file3 As we can see, The commit which commit message is "file1" is missing! I then tested with cgit and found that the cgit result was correct.
Created attachment 287498 [details] test repo
New Gerrit change created: https://git.eclipse.org/r/c/jgit/jgit/+/187660
(In reply to Kyle Zhao from comment #0) > Created attachment 287497 [details] > the test repo > > ``` > mkdir test-path-filter-repo > cd test-path-filter-repo > git init > mkdir -p src/d1 > touch src/d1/file1 > git add * > git commit -m "file1" > git branch b1 > touch src/d1/file2 > git add * > git commit -m "file2" > git checkout b1 > touch src/d1/file3 > git add * > git commit -m "file3" > git checkout master > git merge b1 > ``` > > I used the above commands to create the test repository. > In this test repository, the jgit result of git log - <path> is wrong. > > $ jgit log -- src/d1 > commit 88c7262d9ea93b4f23b6970580908f99c09f10da > Author: kylezhao <kylezhao@tencent.com> > Date: Fri Nov 12 14:56:54 2021 +0800 > > Merge branch 'b1' > > commit 8af1b91e261dcb5b01f4c6efcd1435b661dc0e2e > Author: kylezhao <kylezhao@tencent.com> > Date: Fri Nov 12 14:56:54 2021 +0800 > > file2 > > commit 9a83592dd073777b7e813b5dbe89831df6c1ee45 > Author: kylezhao <kylezhao@tencent.com> > Date: Fri Nov 12 14:56:54 2021 +0800 > > file3 > > > As we can see, The commit which commit message is "file1" is missing! > I then tested with cgit and found that the cgit result was correct. I can't reproduce this using jgit stable-5.13 (35713588f): $ jgit log commit 88c7262d9ea93b4f23b6970580908f99c09f10da Author: kylezhao <kylezhao@tencent.com> Date: Fri Nov 12 14:56:54 2021 +0800 Merge branch 'b1' commit 8af1b91e261dcb5b01f4c6efcd1435b661dc0e2e Author: kylezhao <kylezhao@tencent.com> Date: Fri Nov 12 14:56:54 2021 +0800 file2 commit 9a83592dd073777b7e813b5dbe89831df6c1ee45 Author: kylezhao <kylezhao@tencent.com> Date: Fri Nov 12 14:56:54 2021 +0800 file3 commit 5bf044d5d96704475474a5e5c20898a636837c51 Author: kylezhao <kylezhao@tencent.com> Date: Fri Nov 12 14:56:54 2021 +0800 file1
(In reply to Matthias Sohn from comment #3) > (In reply to Kyle Zhao from comment #0) > > Created attachment 287497 [details] > > the test repo > > > > ``` > > mkdir test-path-filter-repo > > cd test-path-filter-repo > > git init > > mkdir -p src/d1 > > touch src/d1/file1 > > git add * > > git commit -m "file1" > > git branch b1 > > touch src/d1/file2 > > git add * > > git commit -m "file2" > > git checkout b1 > > touch src/d1/file3 > > git add * > > git commit -m "file3" > > git checkout master > > git merge b1 > > ``` > > > > I used the above commands to create the test repository. > > In this test repository, the jgit result of git log - <path> is wrong. > > > > $ jgit log -- src/d1 > > commit 88c7262d9ea93b4f23b6970580908f99c09f10da > > Author: kylezhao <kylezhao@tencent.com> > > Date: Fri Nov 12 14:56:54 2021 +0800 > > > > Merge branch 'b1' > > > > commit 8af1b91e261dcb5b01f4c6efcd1435b661dc0e2e > > Author: kylezhao <kylezhao@tencent.com> > > Date: Fri Nov 12 14:56:54 2021 +0800 > > > > file2 > > > > commit 9a83592dd073777b7e813b5dbe89831df6c1ee45 > > Author: kylezhao <kylezhao@tencent.com> > > Date: Fri Nov 12 14:56:54 2021 +0800 > > > > file3 > > > > > > As we can see, The commit which commit message is "file1" is missing! > > I then tested with cgit and found that the cgit result was correct. > > I can't reproduce this using jgit stable-5.13 (35713588f): > > $ jgit log May be you miss the following parameters ("-- src/d1")? $ jgit log -- src/d1 > commit 88c7262d9ea93b4f23b6970580908f99c09f10da > Author: kylezhao <kylezhao@tencent.com> > Date: Fri Nov 12 14:56:54 2021 +0800 > > Merge branch 'b1' > > commit 8af1b91e261dcb5b01f4c6efcd1435b661dc0e2e > Author: kylezhao <kylezhao@tencent.com> > Date: Fri Nov 12 14:56:54 2021 +0800 > > file2 > > commit 9a83592dd073777b7e813b5dbe89831df6c1ee45 > Author: kylezhao <kylezhao@tencent.com> > Date: Fri Nov 12 14:56:54 2021 +0800 > > file3 > > commit 5bf044d5d96704475474a5e5c20898a636837c51 > Author: kylezhao <kylezhao@tencent.com> > Date: Fri Nov 12 14:56:54 2021 +0800 > > file1
I just downloaded the latest version of jgit self-contained command line[1], then reproduced the problem. $ ./org.eclipse.jgit.pgm-6.0.0.202111291000-r.sh log -- src/d1 commit 88c7262d9ea93b4f23b6970580908f99c09f10da Author: kylezhao <kylezhao@tencent.com> Date: Fri Nov 12 14:56:54 2021 +0800 Merge branch 'b1' commit 8af1b91e261dcb5b01f4c6efcd1435b661dc0e2e Author: kylezhao <kylezhao@tencent.com> Date: Fri Nov 12 14:56:54 2021 +0800 file2 commit 9a83592dd073777b7e813b5dbe89831df6c1ee45 Author: kylezhao <kylezhao@tencent.com> Date: Fri Nov 12 14:56:54 2021 +0800 file3 =============================================================== And here were the results of cgit: $ git log -- src/d1 commit 88c7262d9ea93b4f23b6970580908f99c09f10da (HEAD -> master) Merge: 8af1b91 9a83592 Author: kylezhao <kylezhao@tencent.com> Date: Fri Nov 12 14:56:54 2021 +0800 Merge branch 'b1' commit 8af1b91e261dcb5b01f4c6efcd1435b661dc0e2e Author: kylezhao <kylezhao@tencent.com> Date: Fri Nov 12 14:56:54 2021 +0800 file2 commit 9a83592dd073777b7e813b5dbe89831df6c1ee45 (b1) Author: kylezhao <kylezhao@tencent.com> Date: Fri Nov 12 14:56:54 2021 +0800 file3 commit 5bf044d5d96704475474a5e5c20898a636837c51 Author: kylezhao <kylezhao@tencent.com> Date: Fri Nov 12 14:56:54 2021 +0800 file1 [1] https://download.eclipse.org/jgit/site/6.0.0.202111291000-r/ Regards, Kyle
New Gerrit change created: https://git.eclipse.org/r/c/jgit/jgit/+/188938
(In reply to Kyle Zhao from comment #4) > (In reply to Matthias Sohn from comment #3) > > (In reply to Kyle Zhao from comment #0) > > > Created attachment 287497 [details] > > > the test repo > > > > > > ``` > > > mkdir test-path-filter-repo > > > cd test-path-filter-repo > > > git init > > > mkdir -p src/d1 > > > touch src/d1/file1 > > > git add * > > > git commit -m "file1" > > > git branch b1 > > > touch src/d1/file2 > > > git add * > > > git commit -m "file2" > > > git checkout b1 > > > touch src/d1/file3 > > > git add * > > > git commit -m "file3" > > > git checkout master > > > git merge b1 > > > ``` > > > > > > I used the above commands to create the test repository. > > > In this test repository, the jgit result of git log - <path> is wrong. > > > > > > $ jgit log -- src/d1 > > > commit 88c7262d9ea93b4f23b6970580908f99c09f10da > > > Author: kylezhao <kylezhao@tencent.com> > > > Date: Fri Nov 12 14:56:54 2021 +0800 > > > > > > Merge branch 'b1' > > > > > > commit 8af1b91e261dcb5b01f4c6efcd1435b661dc0e2e > > > Author: kylezhao <kylezhao@tencent.com> > > > Date: Fri Nov 12 14:56:54 2021 +0800 > > > > > > file2 > > > > > > commit 9a83592dd073777b7e813b5dbe89831df6c1ee45 > > > Author: kylezhao <kylezhao@tencent.com> > > > Date: Fri Nov 12 14:56:54 2021 +0800 > > > > > > file3 > > > > > > > > > As we can see, The commit which commit message is "file1" is missing! > > > I then tested with cgit and found that the cgit result was correct. > > > > I can't reproduce this using jgit stable-5.13 (35713588f): > > > > $ jgit log > > May be you miss the following parameters ("-- src/d1")? > $ jgit log -- src/d1 yes, I missed this thanks for the fix, moved it to stable-5.13
Gerrit change https://git.eclipse.org/r/c/jgit/jgit/+/188938 was merged to [stable-5.13]. Commit: http://git.eclipse.org/c/jgit/jgit.git/commit/?id=3d7351ee50b2ef45613b2223856f31e5af1c7ca1
> yes, I missed this > > thanks for the fix, moved it to stable-5.13 Got it. Thanks for your review.