{"thread":{"id":"45566","subject":"git diff --submodule=diff fails with submodules in a submodule","startedAt":"2017-03-31T15:40:54Z","lastAt":"2017-03-31T19:38:24Z","messageCount":5,"participants":["David Parrish","Stefan Beller","Jacob Keller","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"315916","messageId":"CAPd5SoV1F7MMDSRGzrd-7soty=61vnumQ02UtBJs2fwEyv+V3Q@mail.gmail.com","threadId":"45566","inReplyTo":null,"subject":"git diff --submodule=diff fails with submodules in a submodule","fromName":"David Parrish","fromEmail":"daveparrish@gmail.com","sentAt":"2017-03-31T15:40:27Z","receivedAt":"2017-03-31T15:40:54Z","isPatch":false,"sender":{"key":"daveparrish@gmail.com","avatar":null},"body":"When I try to run `git diff --submodule=diff` in a submodule which has\nit's own submodules that have changes I get the error: fatal: bad\nobject\n\nLet me know if you need an example reproduce the issue.\n\nDavid\n"},{"id":"315926","messageId":"CAGZ79kapamr4=C_JQ4Ud2bF6NoXn8qeQR1fYScWB4+-EzEckmQ@mail.gmail.com","threadId":"45566","inReplyTo":"CAPd5SoV1F7MMDSRGzrd-7soty=61vnumQ02UtBJs2fwEyv+V3Q@mail.gmail.com","subject":"Re: git diff --submodule=diff fails with submodules in a submodule","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2017-03-31T17:07:09Z","receivedAt":"2017-03-31T17:07:16Z","isPatch":false,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"+cc Jacob, who implemented --submodule=diff\n\nOn Fri, Mar 31, 2017 at 8:40 AM, David Parrish <daveparrish@gmail.com> wrote:\n> When I try to run `git diff --submodule=diff` in a submodule which has\n> it's own submodules that have changes I get the error: fatal: bad\n> object\n\nThanks for the bug report!\n\n> Let me know if you need an example reproduce the issue.\n\nI could reproduce it when playing around locally with a submodule in\nsubmodules. I think sub-submodule needs to have its HEAD moved from\nthe recorded commit.\n\nThanks,\nStefan\n"},{"id":"315932","messageId":"CA+P7+xoqWCpySc17104zggLgwx1mc0T+JXybrgd8sQxoQFP-PQ@mail.gmail.com","threadId":"45566","inReplyTo":"CAGZ79kapamr4=C_JQ4Ud2bF6NoXn8qeQR1fYScWB4+-EzEckmQ@mail.gmail.com","subject":"Re: git diff --submodule=diff fails with submodules in a submodule","fromName":"Jacob Keller","fromEmail":"jacob.keller@gmail.com","sentAt":"2017-03-31T17:31:51Z","receivedAt":"2017-03-31T17:32:19Z","isPatch":false,"sender":{"key":"jacob.keller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/874719?v=4"},"body":"On Fri, Mar 31, 2017 at 10:07 AM, Stefan Beller <sbeller@google.com> wrote:\n> +cc Jacob, who implemented --submodule=diff\n>\n> On Fri, Mar 31, 2017 at 8:40 AM, David Parrish <daveparrish@gmail.com> wrote:\n>> When I try to run `git diff --submodule=diff` in a submodule which has\n>> it's own submodules that have changes I get the error: fatal: bad\n>> object\n>\n> Thanks for the bug report!\n>\n>> Let me know if you need an example reproduce the issue.\n>\n> I could reproduce it when playing around locally with a submodule in\n> submodules. I think sub-submodule needs to have its HEAD moved from\n> the recorded commit.\n>\n> Thanks,\n> Stefan\n\nHmm. An example reproduction would be helpful. Ideally in the form of\na test ;) But otherwise whatever helps. I will try to look at this,\nbut I'm  busy for a few days.\n\nThanks,\nJake\n"},{"id":"315938","messageId":"20170331175907.17400-1-sbeller@google.com","threadId":"45566","inReplyTo":"CA+P7+xoqWCpySc17104zggLgwx1mc0T+JXybrgd8sQxoQFP-PQ@mail.gmail.com","subject":"[PATCH] failure with diff --submodule=diff with moved nested submodule HEAD","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2017-03-31T17:59:07Z","receivedAt":"2017-03-31T18:00:14Z","isPatch":true,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"This fails reliable for me.\n\nSigned-off-by: Stefan Beller <sbeller@google.com>\n---\n t/t4060-diff-submodule-option-diff-format.sh | 16 ++++++++++++++++\n 1 file changed, 16 insertions(+)\n\ndiff --git a/t/t4060-diff-submodule-option-diff-format.sh b/t/t4060-diff-submodule-option-diff-format.sh\nindex 7e23b55ea4..89bced3484 100755\n--- a/t/t4060-diff-submodule-option-diff-format.sh\n+++ b/t/t4060-diff-submodule-option-diff-format.sh\n@@ -746,4 +746,20 @@ test_expect_success 'diff --submodule=diff with .git file' '\n \ttest_cmp expected actual\n '\n \n+test_expect_success 'setup nested submodule' '\n+\tgit submodule add -f ./sm2 &&\n+\tgit commit -a -m \"add sm2\" &&\n+\tgit -C sm2 submodule add ../sm2 &&\n+\tgit -C sm2 commit -a -m \"nested sub\"\n+'\n+\n+test_expect_success 'move nested submodule HEAD' '\n+\tgit -C sm2/sm2 commit --allow-empty -m \"new HEAD\"\n+'\n+\n+test_expect_success 'diff --submodule=diff with moved nested submodule HEAD' '\n+\tgit -C sm2 diff --submodule=diff >actual 2>err &&\n+\ttest_must_be_empty err\n+'\n+\n test_done\n-- \n2.12.2.511.g2abb8caf66\n\n"},{"id":"315949","messageId":"xmqqk275xmmu.fsf@gitster.mtv.corp.google.com","threadId":"45566","inReplyTo":"20170331175907.17400-1-sbeller@google.com","subject":"Re: [PATCH] failure with diff --submodule=diff with moved nested submodule HEAD","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-03-31T19:38:17Z","receivedAt":"2017-03-31T19:38:24Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Stefan Beller <sbeller@google.com> writes:\n\n> This fails reliable for me.\n>\n> Signed-off-by: Stefan Beller <sbeller@google.com>\n> ---\n\nI take it that this is a WIP for the testing half of the patch you\nare working on (i.e. you are not just throwing a patch to document\nknown breakage to be fixed later, in which case these would have\nbeen _expect_failure).\n\nThanks.\n\n>  t/t4060-diff-submodule-option-diff-format.sh | 16 ++++++++++++++++\n>  1 file changed, 16 insertions(+)\n>\n> diff --git a/t/t4060-diff-submodule-option-diff-format.sh b/t/t4060-diff-submodule-option-diff-format.sh\n> index 7e23b55ea4..89bced3484 100755\n> --- a/t/t4060-diff-submodule-option-diff-format.sh\n> +++ b/t/t4060-diff-submodule-option-diff-format.sh\n> @@ -746,4 +746,20 @@ test_expect_success 'diff --submodule=diff with .git file' '\n>  \ttest_cmp expected actual\n>  '\n>  \n> +test_expect_success 'setup nested submodule' '\n> +\tgit submodule add -f ./sm2 &&\n> +\tgit commit -a -m \"add sm2\" &&\n> +\tgit -C sm2 submodule add ../sm2 &&\n> +\tgit -C sm2 commit -a -m \"nested sub\"\n> +'\n> +\n> +test_expect_success 'move nested submodule HEAD' '\n> +\tgit -C sm2/sm2 commit --allow-empty -m \"new HEAD\"\n> +'\n> +\n> +test_expect_success 'diff --submodule=diff with moved nested submodule HEAD' '\n> +\tgit -C sm2 diff --submodule=diff >actual 2>err &&\n> +\ttest_must_be_empty err\n> +'\n> +\n>  test_done\n"}]}