{"thread":{"id":"48454","subject":"[PATCH] t5310-pack-bitmaps: make JGit tests work with GIT_TEST_SPLIT_INDEX","startedAt":"2018-05-10T13:59:35Z","lastAt":"2018-05-10T14:55:07Z","messageCount":3,"participants":["SZEDER Gábor","Jeff King"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"347226","messageId":"20180510135852.25232-1-szeder.dev@gmail.com","threadId":"48454","inReplyTo":null,"subject":"[PATCH] t5310-pack-bitmaps: make JGit tests work with GIT_TEST_SPLIT_INDEX","fromName":"SZEDER Gábor","fromEmail":"szeder.dev@gmail.com","sentAt":"2018-05-10T13:58:52Z","receivedAt":"2018-05-10T13:59:35Z","isPatch":true,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"The two JGit tests 'we can read jgit bitmaps' and 'jgit can read our\nbitmaps' in 't5310-pack-bitmaps.sh' fail when run with\nGIT_TEST_SPLIT_INDEX=YesPlease.  Both tests create a clone of the test\nrepository to check bitmap interoperability with JGit.  With split\nindexes enabled the index in the clone repositories contains the\n'link' extension, which JGit doesn't support and, consequently, an\nexception aborts it:\n\n  <...>\n  org.eclipse.jgit.api.errors.JGitInternalException: DIRC extension 'link' not supported by this version.\n          at org.eclipse.jgit.dircache.DirCache.readFrom(DirCache.java:562)\n  <...>\n\nSince testing bitmaps doesn't need a worktree in the first place,\nlet's just create bare clones for the two JGit tests, so the cloned\nwon't have an index, and these two tests can be executed even with\nsplit index enabled.\n\nSigned-off-by: SZEDER Gábor <szeder.dev@gmail.com>\n---\n t/t5310-pack-bitmaps.sh | 8 ++++----\n 1 file changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/t/t5310-pack-bitmaps.sh b/t/t5310-pack-bitmaps.sh\nindex f6d600fd82..423c0a475f 100755\n--- a/t/t5310-pack-bitmaps.sh\n+++ b/t/t5310-pack-bitmaps.sh\n@@ -264,9 +264,9 @@ test_expect_success 'pack with missing parent' '\n '\n \n test_expect_success JGIT 'we can read jgit bitmaps' '\n-\tgit clone . compat-jgit &&\n+\tgit clone --bare . compat-jgit.git &&\n \t(\n-\t\tcd compat-jgit &&\n+\t\tcd compat-jgit.git &&\n \t\trm -f .git/objects/pack/*.bitmap &&\n \t\tjgit gc &&\n \t\tgit rev-list --test-bitmap HEAD\n@@ -274,9 +274,9 @@ test_expect_success JGIT 'we can read jgit bitmaps' '\n '\n \n test_expect_success JGIT 'jgit can read our bitmaps' '\n-\tgit clone . compat-us &&\n+\tgit clone --bare . compat-us.git &&\n \t(\n-\t\tcd compat-us &&\n+\t\tcd compat-us.git &&\n \t\tgit repack -adb &&\n \t\t# jgit gc will barf if it does not like our bitmaps\n \t\tjgit gc\n-- \n2.17.0.756.gcf614c5aff\n\n"},{"id":"347244","messageId":"20180510143432.GC25617@sigill.intra.peff.net","threadId":"48454","inReplyTo":"20180510135852.25232-1-szeder.dev@gmail.com","subject":"Re: [PATCH] t5310-pack-bitmaps: make JGit tests work with GIT_TEST_SPLIT_INDEX","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2018-05-10T14:34:33Z","receivedAt":"2018-05-10T14:34:37Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, May 10, 2018 at 03:58:52PM +0200, SZEDER Gábor wrote:\n\n> The two JGit tests 'we can read jgit bitmaps' and 'jgit can read our\n> bitmaps' in 't5310-pack-bitmaps.sh' fail when run with\n> GIT_TEST_SPLIT_INDEX=YesPlease.  Both tests create a clone of the test\n> repository to check bitmap interoperability with JGit.  With split\n> indexes enabled the index in the clone repositories contains the\n> 'link' extension, which JGit doesn't support and, consequently, an\n> exception aborts it:\n> \n>   <...>\n>   org.eclipse.jgit.api.errors.JGitInternalException: DIRC extension 'link' not supported by this version.\n>           at org.eclipse.jgit.dircache.DirCache.readFrom(DirCache.java:562)\n>   <...>\n> \n> Since testing bitmaps doesn't need a worktree in the first place,\n> let's just create bare clones for the two JGit tests, so the cloned\n> won't have an index, and these two tests can be executed even with\n> split index enabled.\n\nNice, this seems like a clever workaround.\n\nReviewed-by: Jeff King <peff@peff.net>\n\nThe more heavy-handed approach would be to just disable the JGIT prereq\nwhen GIT_TEST_SPLIT_INDEX is in use, which would cover this and\npotentially any other cases. This is nicer because it lets us continue\nusing the test. And it's not like we have a ton of jgit dependencies,\nsuch that dealing with each individually would be a burden.\n\n-Peff\n"},{"id":"347246","messageId":"CAM0VKjnVAWdxL152MGQWFmJdHC99F=PjKpj9GdU62NV40XJi=A@mail.gmail.com","threadId":"48454","inReplyTo":"20180510143432.GC25617@sigill.intra.peff.net","subject":"Re: [PATCH] t5310-pack-bitmaps: make JGit tests work with GIT_TEST_SPLIT_INDEX","fromName":"SZEDER Gábor","fromEmail":"szeder.dev@gmail.com","sentAt":"2018-05-10T14:55:03Z","receivedAt":"2018-05-10T14:55:07Z","isPatch":true,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"On Thu, May 10, 2018 at 4:34 PM, Jeff King <peff@peff.net> wrote:\n> On Thu, May 10, 2018 at 03:58:52PM +0200, SZEDER Gábor wrote:\n>> Since testing bitmaps doesn't need a worktree in the first place,\n>> let's just create bare clones for the two JGit tests, so the cloned\n>> won't have an index, and these two tests can be executed even with\n>> split index enabled.\n>\n> Nice, this seems like a clever workaround.\n>\n> Reviewed-by: Jeff King <peff@peff.net>\n>\n> The more heavy-handed approach would be to just disable the JGIT prereq\n> when GIT_TEST_SPLIT_INDEX is in use, which would cover this and\n> potentially any other cases. This is nicer because it lets us continue\n> using the test. And it's not like we have a ton of jgit dependencies,\n> such that dealing with each individually would be a burden.\n\nWe could also 'sane_unset GIT_TEST_SPLIT_INDEX' in these two tests,\nbut I think that we should do that only in tests that specifically\ncheck split index behavior (i.e. t1700).\n"}]}