{"thread":{"id":"57686","subject":"Git 2.36, ls-tree submodule regression?","startedAt":"2022-04-07T00:34:43Z","lastAt":"2022-04-07T18:20:47Z","messageCount":6,"participants":["Bryan Turner","Teng Long","Johannes Schindelin","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"453239","messageId":"CAGyf7-FjqrGYTUwdS=a6nsUnbn0qD9=Pf2Nx=gy6g8KGVRJivw@mail.gmail.com","threadId":"57686","inReplyTo":null,"subject":"Git 2.36, ls-tree submodule regression?","fromName":"Bryan Turner","fromEmail":"bturner@atlassian.com","sentAt":"2022-04-07T00:34:25Z","receivedAt":"2022-04-07T00:34:43Z","isPatch":false,"sender":{"key":"bturner@atlassian.com","avatar":"https://gravatar.com/avatar/16bcf3167981c1ef7c804e502642366d888a35b0d0b0a4ca01fdc442aa1acb1e?d=mp&s=160"},"body":"In the test suite for Bitbucket Server, we have a test repository[1]\nwhich has a commit that has a .gitmodules file that lists 3\nsubmodules, each of which has an entry in the tree with \"Subproject\ncommit <SHA>\".\n\nThe submodules aren't fetched (at least one of them doesn't actually\nexist anywhere to fetch), but running git ls-tree in Git 2.35.1 and\nprior shows the expected tree data:\n\n$ git ls-tree -r -l ecf42d8adc4d7eb4386e37882d053704067712d4: --\n100644 blob c0de405f50ea72f9d2b973dd504671ba63ea7189     346 .gitmodules\n100644 blob 493021b1c9e0ecfebcd5ebce646a44138bc60b39      20\nadd_file/add_file.txt\n100644 blob d8c00a7fe6eb6a00378e103a46e3c472c084a949      25\nbasic_branching/file.txt\n100644 blob 927b01c060cf0dc5036e19abeab8e332d9075ea0     167 binary/B.zip\n100644 blob 72555d02a139700be930a6734b57c5fab84512b9     167 binary/C.zip\n100644 blob 72555d02a139700be930a6734b57c5fab84512b9     167 binary/D.zip\n100644 blob 668076c308990933c2df66efb87b946704252486      46\nbranch_mod_merge/file.txt\n100644 blob b1d99e581f0bb8138b8997f9268294e41faee05b      33\nmodification/mod_file.txt\n100644 blob 46fa903c8af8a92c2714a47ae5a341a99c2ee3b2      18 moved_dir/file.txt\n100644 blob f49abb7d6c366e6f83470e36439bc162234d7963      24\nmv_file/moved_file.txt\n100644 blob 2e6b03cbbe90d3c9afcfc98967a5a71b4c9cff1a      66\nout_of_order/file.txt\n160000 commit 0ac826865ce7e8bc76022d49424f52e09b16dc87       -\nsubmodule/atlassian-refapp\n160000 commit 92b18c97d9d92d2bd02cfd1d268f22fddddafb67       -\nsubmodule/bamboo-git-plugin\n160000 commit 996b4f5a7e242a29fe573582d98f5174142bb97c       - submodule/stash\n120000 blob 4cbb553f3f4ac2ee7b01ff6c951d6bf583c39c15      10 symlink/link.txt\n100644 blob 57a3592bb2cf8e76e2faef7660945a2fe0e24360      27 symlink/target.txt\n\nThe same ls-tree command in 2.36.0-rc0 fails:\n\n$ /opt/git/2.36.0-rc0/bin/git ls-tree -r -l\necf42d8adc4d7eb4386e37882d053704067712d4: --\n100644 blob c0de405f50ea72f9d2b973dd504671ba63ea7189     346 .gitmodules\n100644 blob 493021b1c9e0ecfebcd5ebce646a44138bc60b39      20\nadd_file/add_file.txt\n100644 blob d8c00a7fe6eb6a00378e103a46e3c472c084a949      25\nbasic_branching/file.txt\n100644 blob 927b01c060cf0dc5036e19abeab8e332d9075ea0     167 binary/B.zip\n100644 blob 72555d02a139700be930a6734b57c5fab84512b9     167 binary/C.zip\n100644 blob 72555d02a139700be930a6734b57c5fab84512b9     167 binary/D.zip\n100644 blob 668076c308990933c2df66efb87b946704252486      46\nbranch_mod_merge/file.txt\n100644 blob b1d99e581f0bb8138b8997f9268294e41faee05b      33\nmodification/mod_file.txt\n100644 blob 46fa903c8af8a92c2714a47ae5a341a99c2ee3b2      18 moved_dir/file.txt\n100644 blob f49abb7d6c366e6f83470e36439bc162234d7963      24\nmv_file/moved_file.txt\n100644 blob 2e6b03cbbe90d3c9afcfc98967a5a71b4c9cff1a      66\nout_of_order/file.txt\n160000 commit 0ac826865ce7e8bc76022d49424f52e09b16dc87       -\nsubmodule/atlassian-refapp\nerror: Could not read 0ac826865ce7e8bc76022d49424f52e09b16dc87\nfatal: Invalid commit 0ac826865ce7e8bc76022d49424f52e09b16dc87 in\nsubmodule path submodule/atlassian-refapp\n\nBisecting the error selects:\n\n$ git bisect good\n9c4d58ff2c385f49585197c8650356955e1fa02e is the first bad commit\ncommit 9c4d58ff2c385f49585197c8650356955e1fa02e\nAuthor: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\nDate:   Wed Mar 23 17:13:15 2022 +0800\n\n    ls-tree: split up \"fast path\" callbacks\n\n    Make the various if/else in the callbacks for the \"fast path\" a lot\n    easier to read by just using common functions for the parts that are\n    common, and have per-format callbacks for those parts that are\n    different.\n\n    Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n    Signed-off-by: Teng Long <dyroneteng@gmail.com>\n    Signed-off-by: Junio C Hamano <gitster@pobox.com>\n\n builtin/ls-tree.c | 199 ++++++++++++++++++++++++++++++++++--------------------\n 1 file changed, 125 insertions(+), 74 deletions(-)\n\n(I've CC'd Ævar and Teng on this message.)\n\nLooking at the changes in that commit I see differences in the\nhandling for long listings, so I tried removing the -l. At that point,\nthe command works again:\n\n$ /opt/git/2.36.0-rc0/bin/git ls-tree -r\necf42d8adc4d7eb4386e37882d053704067712d4: --\n100644 blob c0de405f50ea72f9d2b973dd504671ba63ea7189 .gitmodules\n100644 blob 493021b1c9e0ecfebcd5ebce646a44138bc60b39 add_file/add_file.txt\n100644 blob d8c00a7fe6eb6a00378e103a46e3c472c084a949 basic_branching/file.txt\n100644 blob 927b01c060cf0dc5036e19abeab8e332d9075ea0 binary/B.zip\n100644 blob 72555d02a139700be930a6734b57c5fab84512b9 binary/C.zip\n100644 blob 72555d02a139700be930a6734b57c5fab84512b9 binary/D.zip\n100644 blob 668076c308990933c2df66efb87b946704252486 branch_mod_merge/file.txt\n100644 blob b1d99e581f0bb8138b8997f9268294e41faee05b modification/mod_file.txt\n100644 blob 46fa903c8af8a92c2714a47ae5a341a99c2ee3b2 moved_dir/file.txt\n100644 blob f49abb7d6c366e6f83470e36439bc162234d7963 mv_file/moved_file.txt\n100644 blob 2e6b03cbbe90d3c9afcfc98967a5a71b4c9cff1a out_of_order/file.txt\n160000 commit 0ac826865ce7e8bc76022d49424f52e09b16dc87\nsubmodule/atlassian-refapp\n160000 commit 92b18c97d9d92d2bd02cfd1d268f22fddddafb67\nsubmodule/bamboo-git-plugin\n160000 commit 996b4f5a7e242a29fe573582d98f5174142bb97c submodule/stash\n120000 blob 4cbb553f3f4ac2ee7b01ff6c951d6bf583c39c15 symlink/link.txt\n100644 blob 57a3592bb2cf8e76e2faef7660945a2fe0e24360 symlink/target.txt\n\nGiven the command works without -l, and all -l is supposed to do is\nadd sizes to blobs, it seems like something has regressed in the logic\nthat decides whether to continue recursing or move on to the next\nsibling?\n\nCan someone else whose C is a little less rusty check this and see if\nit's a bug? It almost seems like it _has_ to be, though. Bitbucket\nServer manages bare repositories which often include submodules, but\nnone of those submodules (even assuming they're valid, which is not\nalways the case for repositories in the wild) are ever _fetched_ into\nthat bare repository. That implies this would always fail in any\nrepository that contains submodules referencing other repositories.\n\nBest regards,\nBryan Turner\n\n[1] https://packages.atlassian.com/maven/com/atlassian/stash/git/subrepositories/1.0/subrepositories-1.0.zip\nis a zipped bare repository that contains the ecf42d8 commit used\nabove\n"},{"id":"453240","messageId":"CAGyf7-FiAjQGh8vo-oA6j8SH4se2rpU4_09dzUgxmE7Ohy72Kw@mail.gmail.com","threadId":"57686","inReplyTo":"CAGyf7-FjqrGYTUwdS=a6nsUnbn0qD9=Pf2Nx=gy6g8KGVRJivw@mail.gmail.com","subject":"Re: Git 2.36, ls-tree submodule regression?","fromName":"Bryan Turner","fromEmail":"bturner@atlassian.com","sentAt":"2022-04-07T01:29:35Z","receivedAt":"2022-04-07T01:32:29Z","isPatch":false,"sender":{"key":"bturner@atlassian.com","avatar":"https://gravatar.com/avatar/16bcf3167981c1ef7c804e502642366d888a35b0d0b0a4ca01fdc442aa1acb1e?d=mp&s=160"},"body":"On Wed, Apr 6, 2022 at 5:34 PM Bryan Turner <bturner@atlassian.com> wrote:\n>\n> In the test suite for Bitbucket Server, we have a test repository[1]\n> which has a commit that has a .gitmodules file that lists 3\n> submodules, each of which has an entry in the tree with \"Subproject\n> commit <SHA>\".\n>\n> The submodules aren't fetched (at least one of them doesn't actually\n> exist anywhere to fetch), but running git ls-tree in Git 2.35.1 and\n> prior shows the expected tree data:\n>\n> $ git ls-tree -r -l ecf42d8adc4d7eb4386e37882d053704067712d4: --\n> 100644 blob c0de405f50ea72f9d2b973dd504671ba63ea7189     346 .gitmodules\n> 100644 blob 493021b1c9e0ecfebcd5ebce646a44138bc60b39      20\n> add_file/add_file.txt\n> 100644 blob d8c00a7fe6eb6a00378e103a46e3c472c084a949      25\n> basic_branching/file.txt\n> 100644 blob 927b01c060cf0dc5036e19abeab8e332d9075ea0     167 binary/B.zip\n> 100644 blob 72555d02a139700be930a6734b57c5fab84512b9     167 binary/C.zip\n> 100644 blob 72555d02a139700be930a6734b57c5fab84512b9     167 binary/D.zip\n> 100644 blob 668076c308990933c2df66efb87b946704252486      46\n> branch_mod_merge/file.txt\n> 100644 blob b1d99e581f0bb8138b8997f9268294e41faee05b      33\n> modification/mod_file.txt\n> 100644 blob 46fa903c8af8a92c2714a47ae5a341a99c2ee3b2      18 moved_dir/file.txt\n> 100644 blob f49abb7d6c366e6f83470e36439bc162234d7963      24\n> mv_file/moved_file.txt\n> 100644 blob 2e6b03cbbe90d3c9afcfc98967a5a71b4c9cff1a      66\n> out_of_order/file.txt\n> 160000 commit 0ac826865ce7e8bc76022d49424f52e09b16dc87       -\n> submodule/atlassian-refapp\n> 160000 commit 92b18c97d9d92d2bd02cfd1d268f22fddddafb67       -\n> submodule/bamboo-git-plugin\n> 160000 commit 996b4f5a7e242a29fe573582d98f5174142bb97c       - submodule/stash\n> 120000 blob 4cbb553f3f4ac2ee7b01ff6c951d6bf583c39c15      10 symlink/link.txt\n> 100644 blob 57a3592bb2cf8e76e2faef7660945a2fe0e24360      27 symlink/target.txt\n>\n> The same ls-tree command in 2.36.0-rc0 fails:\n>\n> $ /opt/git/2.36.0-rc0/bin/git ls-tree -r -l\n> ecf42d8adc4d7eb4386e37882d053704067712d4: --\n> 100644 blob c0de405f50ea72f9d2b973dd504671ba63ea7189     346 .gitmodules\n> 100644 blob 493021b1c9e0ecfebcd5ebce646a44138bc60b39      20\n> add_file/add_file.txt\n> 100644 blob d8c00a7fe6eb6a00378e103a46e3c472c084a949      25\n> basic_branching/file.txt\n> 100644 blob 927b01c060cf0dc5036e19abeab8e332d9075ea0     167 binary/B.zip\n> 100644 blob 72555d02a139700be930a6734b57c5fab84512b9     167 binary/C.zip\n> 100644 blob 72555d02a139700be930a6734b57c5fab84512b9     167 binary/D.zip\n> 100644 blob 668076c308990933c2df66efb87b946704252486      46\n> branch_mod_merge/file.txt\n> 100644 blob b1d99e581f0bb8138b8997f9268294e41faee05b      33\n> modification/mod_file.txt\n> 100644 blob 46fa903c8af8a92c2714a47ae5a341a99c2ee3b2      18 moved_dir/file.txt\n> 100644 blob f49abb7d6c366e6f83470e36439bc162234d7963      24\n> mv_file/moved_file.txt\n> 100644 blob 2e6b03cbbe90d3c9afcfc98967a5a71b4c9cff1a      66\n> out_of_order/file.txt\n> 160000 commit 0ac826865ce7e8bc76022d49424f52e09b16dc87       -\n> submodule/atlassian-refapp\n> error: Could not read 0ac826865ce7e8bc76022d49424f52e09b16dc87\n> fatal: Invalid commit 0ac826865ce7e8bc76022d49424f52e09b16dc87 in\n> submodule path submodule/atlassian-refapp\n>\n> Bisecting the error selects:\n>\n> $ git bisect good\n> 9c4d58ff2c385f49585197c8650356955e1fa02e is the first bad commit\n> commit 9c4d58ff2c385f49585197c8650356955e1fa02e\n> Author: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n> Date:   Wed Mar 23 17:13:15 2022 +0800\n>\n>     ls-tree: split up \"fast path\" callbacks\n>\n>     Make the various if/else in the callbacks for the \"fast path\" a lot\n>     easier to read by just using common functions for the parts that are\n>     common, and have per-format callbacks for those parts that are\n>     different.\n>\n>     Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n>     Signed-off-by: Teng Long <dyroneteng@gmail.com>\n>     Signed-off-by: Junio C Hamano <gitster@pobox.com>\n>\n>  builtin/ls-tree.c | 199 ++++++++++++++++++++++++++++++++++--------------------\n>  1 file changed, 125 insertions(+), 74 deletions(-)\n>\n> (I've CC'd Ævar and Teng on this message.)\n\nActually, it looks like Ævar might already have a fix up for it in\n[2]. I'll see if I can apply that patch locally and verify it.\n\nBest regards,\nBryan Turner\n\n[2] https://lore.kernel.org/git/patch-v2-1.1-ed83b3b74ab-20220404T234507Z-avarab@gmail.com/\n"},{"id":"453241","messageId":"CAGyf7-EoJzN0ECuhXFDbmKGvN2dKUEJRq7vR=AnOfOcp5kFXow@mail.gmail.com","threadId":"57686","inReplyTo":"CAGyf7-FiAjQGh8vo-oA6j8SH4se2rpU4_09dzUgxmE7Ohy72Kw@mail.gmail.com","subject":"Re: Git 2.36, ls-tree submodule regression?","fromName":"Bryan Turner","fromEmail":"bturner@atlassian.com","sentAt":"2022-04-07T01:41:23Z","receivedAt":"2022-04-07T01:43:21Z","isPatch":false,"sender":{"key":"bturner@atlassian.com","avatar":"https://gravatar.com/avatar/16bcf3167981c1ef7c804e502642366d888a35b0d0b0a4ca01fdc442aa1acb1e?d=mp&s=160"},"body":"On Wed, Apr 6, 2022 at 6:29 PM Bryan Turner <bturner@atlassian.com> wrote:\n>\n> On Wed, Apr 6, 2022 at 5:34 PM Bryan Turner <bturner@atlassian.com> wrote:\n> >\n> > In the test suite for Bitbucket Server, we have a test repository[1]\n> > which has a commit that has a .gitmodules file that lists 3\n> > submodules, each of which has an entry in the tree with \"Subproject\n> > commit <SHA>\".\n> >\n> > The submodules aren't fetched (at least one of them doesn't actually\n> > exist anywhere to fetch), but running git ls-tree in Git 2.35.1 and\n> > prior shows the expected tree data:\n> >\n> > $ git ls-tree -r -l ecf42d8adc4d7eb4386e37882d053704067712d4: --\n> > 100644 blob c0de405f50ea72f9d2b973dd504671ba63ea7189     346 .gitmodules\n> > 100644 blob 493021b1c9e0ecfebcd5ebce646a44138bc60b39      20\n> > add_file/add_file.txt\n> > 100644 blob d8c00a7fe6eb6a00378e103a46e3c472c084a949      25\n> > basic_branching/file.txt\n> > 100644 blob 927b01c060cf0dc5036e19abeab8e332d9075ea0     167 binary/B.zip\n> > 100644 blob 72555d02a139700be930a6734b57c5fab84512b9     167 binary/C.zip\n> > 100644 blob 72555d02a139700be930a6734b57c5fab84512b9     167 binary/D.zip\n> > 100644 blob 668076c308990933c2df66efb87b946704252486      46\n> > branch_mod_merge/file.txt\n> > 100644 blob b1d99e581f0bb8138b8997f9268294e41faee05b      33\n> > modification/mod_file.txt\n> > 100644 blob 46fa903c8af8a92c2714a47ae5a341a99c2ee3b2      18 moved_dir/file.txt\n> > 100644 blob f49abb7d6c366e6f83470e36439bc162234d7963      24\n> > mv_file/moved_file.txt\n> > 100644 blob 2e6b03cbbe90d3c9afcfc98967a5a71b4c9cff1a      66\n> > out_of_order/file.txt\n> > 160000 commit 0ac826865ce7e8bc76022d49424f52e09b16dc87       -\n> > submodule/atlassian-refapp\n> > 160000 commit 92b18c97d9d92d2bd02cfd1d268f22fddddafb67       -\n> > submodule/bamboo-git-plugin\n> > 160000 commit 996b4f5a7e242a29fe573582d98f5174142bb97c       - submodule/stash\n> > 120000 blob 4cbb553f3f4ac2ee7b01ff6c951d6bf583c39c15      10 symlink/link.txt\n> > 100644 blob 57a3592bb2cf8e76e2faef7660945a2fe0e24360      27 symlink/target.txt\n> >\n> > The same ls-tree command in 2.36.0-rc0 fails:\n> >\n> > $ /opt/git/2.36.0-rc0/bin/git ls-tree -r -l\n> > ecf42d8adc4d7eb4386e37882d053704067712d4: --\n> > 100644 blob c0de405f50ea72f9d2b973dd504671ba63ea7189     346 .gitmodules\n> > 100644 blob 493021b1c9e0ecfebcd5ebce646a44138bc60b39      20\n> > add_file/add_file.txt\n> > 100644 blob d8c00a7fe6eb6a00378e103a46e3c472c084a949      25\n> > basic_branching/file.txt\n> > 100644 blob 927b01c060cf0dc5036e19abeab8e332d9075ea0     167 binary/B.zip\n> > 100644 blob 72555d02a139700be930a6734b57c5fab84512b9     167 binary/C.zip\n> > 100644 blob 72555d02a139700be930a6734b57c5fab84512b9     167 binary/D.zip\n> > 100644 blob 668076c308990933c2df66efb87b946704252486      46\n> > branch_mod_merge/file.txt\n> > 100644 blob b1d99e581f0bb8138b8997f9268294e41faee05b      33\n> > modification/mod_file.txt\n> > 100644 blob 46fa903c8af8a92c2714a47ae5a341a99c2ee3b2      18 moved_dir/file.txt\n> > 100644 blob f49abb7d6c366e6f83470e36439bc162234d7963      24\n> > mv_file/moved_file.txt\n> > 100644 blob 2e6b03cbbe90d3c9afcfc98967a5a71b4c9cff1a      66\n> > out_of_order/file.txt\n> > 160000 commit 0ac826865ce7e8bc76022d49424f52e09b16dc87       -\n> > submodule/atlassian-refapp\n> > error: Could not read 0ac826865ce7e8bc76022d49424f52e09b16dc87\n> > fatal: Invalid commit 0ac826865ce7e8bc76022d49424f52e09b16dc87 in\n> > submodule path submodule/atlassian-refapp\n> >\n> > Bisecting the error selects:\n> >\n> > $ git bisect good\n> > 9c4d58ff2c385f49585197c8650356955e1fa02e is the first bad commit\n> > commit 9c4d58ff2c385f49585197c8650356955e1fa02e\n> > Author: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n> > Date:   Wed Mar 23 17:13:15 2022 +0800\n> >\n> >     ls-tree: split up \"fast path\" callbacks\n> >\n> >     Make the various if/else in the callbacks for the \"fast path\" a lot\n> >     easier to read by just using common functions for the parts that are\n> >     common, and have per-format callbacks for those parts that are\n> >     different.\n> >\n> >     Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n> >     Signed-off-by: Teng Long <dyroneteng@gmail.com>\n> >     Signed-off-by: Junio C Hamano <gitster@pobox.com>\n> >\n> >  builtin/ls-tree.c | 199 ++++++++++++++++++++++++++++++++++--------------------\n> >  1 file changed, 125 insertions(+), 74 deletions(-)\n> >\n> > (I've CC'd Ævar and Teng on this message.)\n>\n> Actually, it looks like Ævar might already have a fix up for it in\n> [2]. I'll see if I can apply that patch locally and verify it.\n\nConfirmed that what's currently in \"next\" (which I believe will become\n2.36.0-rc1 at some point?) does not manifest this issue.\n\nThanks for the fix--posted before I could even ask for it--and sorry\nfor the noise.\n\nBest regards,\nBryan Turner\n"},{"id":"453242","messageId":"20220407022207.12542-1-dyroneteng@gmail.com","threadId":"57686","inReplyTo":"CAGyf7-FjqrGYTUwdS=a6nsUnbn0qD9=Pf2Nx=gy6g8KGVRJivw@mail.gmail.com","subject":"Re: Git 2.36, ls-tree submodule regression?","fromName":"Teng Long","fromEmail":"dyroneteng@gmail.com","sentAt":"2022-04-07T02:22:07Z","receivedAt":"2022-04-07T02:22:18Z","isPatch":false,"sender":{"key":"dyroneteng@gmail.com","avatar":"https://avatars.githubusercontent.com/u/7803958?v=4"},"body":"> Bisecting the error selects:\n> \n> $ git bisect good\n> 9c4d58ff2c385f49585197c8650356955e1fa02e is the first bad commit\n> commit 9c4d58ff2c385f49585197c8650356955e1fa02e\n> Author: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n> Date:   Wed Mar 23 17:13:15 2022 +0800\n> \n>     ls-tree: split up \"fast path\" callbacks\n> \n>     Make the various if/else in the callbacks for the \"fast path\" a lot\n>     easier to read by just using common functions for the parts that are\n>     common, and have per-format callbacks for those parts that are\n>     different.\n> \n>     Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n>     Signed-off-by: Teng Long <dyroneteng@gmail.com>\n>     Signed-off-by: Junio C Hamano <gitster@pobox.com>\n> \n>  builtin/ls-tree.c | 199 ++++++++++++++++++++++++++++++++++--------------------\n>  1 file changed, 125 insertions(+), 74 deletions(-)\n> \n> (I've CC'd Ævar and Teng on this message.)\n> \n> Looking at the changes in that commit I see differences in the\n> handling for long listings, so I tried removing the -l. At that point,\n> the command works again:\n\nYes, it's a bug but already found and fixed by Ævar Arnfjörð Bjarmason.\n\n> Given the command works without -l, and all -l is supposed to do is\n> add sizes to blobs, it seems like something has regressed in the logic\n> that decides whether to continue recursing or move on to the next\n> sibling?\n\nAs you described blow, I almost comfirmed it's the problem that\nfound in [1] and Junio C Hamano already replied it in [2]\n \n> Can someone else whose C is a little less rusty check this and see if\n> it's a bug? It almost seems like it _has_ to be, though. Bitbucket\n> Server manages bare repositories which often include submodules, but\n> none of those submodules (even assuming they're valid, which is not\n> always the case for repositories in the wild) are ever _fetched_ into\n> that bare repository. That implies this would always fail in any\n> repository that contains submodules referencing other repositories.\n\nSorry for the trouble.\n\nThank you for debugging this and reporting this problem. \n\nLinks:\n\n  1. https://public-inbox.org/git/YktP0LltNKq7JZZs@google.com/\n  2. https://public-inbox.org/git/xmqq8rsi1ap4.fsf@gitster.g/\n"},{"id":"453254","messageId":"nycvar.QRO.7.76.6.2204071436150.347@tvgsbejvaqbjf.bet","threadId":"57686","inReplyTo":"20220407022207.12542-1-dyroneteng@gmail.com","subject":"Re: Git 2.36, ls-tree submodule regression?","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2022-04-07T12:37:12Z","receivedAt":"2022-04-07T12:37:22Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Thu, 7 Apr 2022, Teng Long wrote:\n\n> > Bisecting the error selects:\n> >\n> > $ git bisect good\n> > 9c4d58ff2c385f49585197c8650356955e1fa02e is the first bad commit\n> > commit 9c4d58ff2c385f49585197c8650356955e1fa02e\n> > Author: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n> > Date:   Wed Mar 23 17:13:15 2022 +0800\n> >\n> >     ls-tree: split up \"fast path\" callbacks\n> >\n> >     Make the various if/else in the callbacks for the \"fast path\" a lot\n> >     easier to read by just using common functions for the parts that are\n> >     common, and have per-format callbacks for those parts that are\n> >     different.\n> >\n> >     Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n> >     Signed-off-by: Teng Long <dyroneteng@gmail.com>\n> >     Signed-off-by: Junio C Hamano <gitster@pobox.com>\n> >\n> >  builtin/ls-tree.c | 199 ++++++++++++++++++++++++++++++++++--------------------\n> >  1 file changed, 125 insertions(+), 74 deletions(-)\n> >\n> > (I've CC'd Ævar and Teng on this message.)\n> >\n> > Looking at the changes in that commit I see differences in the\n> > handling for long listings, so I tried removing the -l. At that point,\n> > the command works again:\n>\n> Yes, it's a bug but already found and fixed by Ævar Arnfjörð Bjarmason.\n\nCorrection, it was fixed by Josh Steadmon, and Ævar proposed an\nalternative, but Josh's version made it into the `main` branch:\n\nhttps://github.com/git/git/commit/350296cc78912c245847ec65e55143053450cce1\n\nCiao,\nJohannes\n"},{"id":"453282","messageId":"xmqqk0c0sqku.fsf@gitster.g","threadId":"57686","inReplyTo":"nycvar.QRO.7.76.6.2204071436150.347@tvgsbejvaqbjf.bet","subject":"Re: Git 2.36, ls-tree submodule regression?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2022-04-07T18:20:33Z","receivedAt":"2022-04-07T18:20:47Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> Correction, it was fixed by Josh Steadmon, and Ævar proposed an\n> alternative, but Josh's version made it into the `main` branch:\n\nCorrect, although the actual fixes were identical one-liner and it\ndidn't really matter in the end result where the fix was taken from.\n"}]}