{"thread":{"id":"54276","subject":"git diff --name-only --submodule=diff combination does not work","startedAt":"2020-09-22T20:57:25Z","lastAt":"2020-09-24T06:38:33Z","messageCount":4,"participants":["Ilan Biala","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"406136","messageId":"CAD2jYq_-yOgVDd8280+T1E1hT1r0DfN1xFN6V0Hz_v7wnsENpQ@mail.gmail.com","threadId":"54276","inReplyTo":"20200922193407.23931C0613CF@lindbergh.monkeyblade.net","subject":"git diff --name-only --submodule=diff combination does not work","fromName":"Ilan Biala","fromEmail":"ilanbiala@gmail.com","sentAt":"2020-09-22T20:56:45Z","receivedAt":"2020-09-22T20:57:25Z","isPatch":false,"sender":{"key":"ilanbiala@gmail.com","avatar":null},"body":"Hi,\n\nI've been running into issues with using the --name-only and\n--submodule=diff flags together in Git 2.27.0. Is this a known bug?\n\nThanks,\nIlan\n"},{"id":"406137","messageId":"20200922212404.GA547416@coredump.intra.peff.net","threadId":"54276","inReplyTo":"CAD2jYq_-yOgVDd8280+T1E1hT1r0DfN1xFN6V0Hz_v7wnsENpQ@mail.gmail.com","subject":"Re: git diff --name-only --submodule=diff combination does not work","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2020-09-22T21:24:04Z","receivedAt":"2020-09-22T21:24:07Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Sep 22, 2020 at 04:56:45PM -0400, Ilan Biala wrote:\n\n> I've been running into issues with using the --name-only and\n> --submodule=diff flags together in Git 2.27.0. Is this a known bug?\n\nWhat did you expect it to do, and what did it do instead?\n\nI'm not very familiar with the --submodule flag, but it looks like it\nonly impacts \"--patch\" output. E.g., in git.git (with the submodule\nactually populated):\n\n  $ git log --oneline --submodule=diff -p sha1collisiondetection\n  4125f78222 sha1dc: update from upstream\n  Submodule sha1collisiondetection 16033998da..855827c583:\n    > Detect endianess on HP-UX\n  07a20f569b Makefile: fix unaligned loads in sha1dc with UBSan\n  Submodule sha1collisiondetection 232357eb2e..16033998da:\n    > Shorter version of force aligned access.\n    > Add compiler option to force aligned access even for Intel CPUs.\n  23e37f8e9d sha1dc: update from upstream\n  Submodule sha1collisiondetection 19d97bf5af..232357eb2e:\n    > Merge pull request #45 from avar/aix-big-endian-detection\n    > sha1c: fix a trivial spelling error\n  86cfd61e6b sha1dc: optionally use sha1collisiondetection as a submodule\n  Submodule sha1collisiondetection 0000000000...19d97bf5af (new submodule)\n\n  $ git log --oneline --submodule=log --raw sha1collisiondetection\n  4125f78222 sha1dc: update from upstream\n  :160000 160000 16033998da 855827c583 M  sha1collisiondetection\n  07a20f569b Makefile: fix unaligned loads in sha1dc with UBSan\n  :160000 160000 232357eb2e 16033998da M  sha1collisiondetection\n  23e37f8e9d sha1dc: update from upstream\n  :160000 160000 19d97bf5af 232357eb2e M  sha1collisiondetection\n  86cfd61e6b sha1dc: optionally use sha1collisiondetection as a submodule\n  :000000 160000 0000000000 19d97bf5af A  sha1collisiondetection\n\n-Peff\n"},{"id":"406138","messageId":"CAD2jYq8OtHUpfUZyXC_+FHew45XEtgty3H-XF_2e30mb6kCCmw@mail.gmail.com","threadId":"54276","inReplyTo":"20200922212404.GA547416@coredump.intra.peff.net","subject":"Re: git diff --name-only --submodule=diff combination does not work","fromName":"Ilan Biala","fromEmail":"ilanbiala@gmail.com","sentAt":"2020-09-22T21:32:12Z","receivedAt":"2020-09-22T21:32:50Z","isPatch":false,"sender":{"key":"ilanbiala@gmail.com","avatar":null},"body":"I expected adding --submodule=diff to add all the filenames in\nsubmodules that were modified, but the output just shows the submodule\nfolder name, not all the files within the submodule that were\nmodified.\n\nOn Tue, Sep 22, 2020 at 5:24 PM Jeff King <peff@peff.net> wrote:\n>\n> On Tue, Sep 22, 2020 at 04:56:45PM -0400, Ilan Biala wrote:\n>\n> > I've been running into issues with using the --name-only and\n> > --submodule=diff flags together in Git 2.27.0. Is this a known bug?\n>\n> What did you expect it to do, and what did it do instead?\n>\n> I'm not very familiar with the --submodule flag, but it looks like it\n> only impacts \"--patch\" output. E.g., in git.git (with the submodule\n> actually populated):\n>\n>   $ git log --oneline --submodule=diff -p sha1collisiondetection\n>   4125f78222 sha1dc: update from upstream\n>   Submodule sha1collisiondetection 16033998da..855827c583:\n>     > Detect endianess on HP-UX\n>   07a20f569b Makefile: fix unaligned loads in sha1dc with UBSan\n>   Submodule sha1collisiondetection 232357eb2e..16033998da:\n>     > Shorter version of force aligned access.\n>     > Add compiler option to force aligned access even for Intel CPUs.\n>   23e37f8e9d sha1dc: update from upstream\n>   Submodule sha1collisiondetection 19d97bf5af..232357eb2e:\n>     > Merge pull request #45 from avar/aix-big-endian-detection\n>     > sha1c: fix a trivial spelling error\n>   86cfd61e6b sha1dc: optionally use sha1collisiondetection as a submodule\n>   Submodule sha1collisiondetection 0000000000...19d97bf5af (new submodule)\n>\n>   $ git log --oneline --submodule=log --raw sha1collisiondetection\n>   4125f78222 sha1dc: update from upstream\n>   :160000 160000 16033998da 855827c583 M  sha1collisiondetection\n>   07a20f569b Makefile: fix unaligned loads in sha1dc with UBSan\n>   :160000 160000 232357eb2e 16033998da M  sha1collisiondetection\n>   23e37f8e9d sha1dc: update from upstream\n>   :160000 160000 19d97bf5af 232357eb2e M  sha1collisiondetection\n>   86cfd61e6b sha1dc: optionally use sha1collisiondetection as a submodule\n>   :000000 160000 0000000000 19d97bf5af A  sha1collisiondetection\n>\n> -Peff\n"},{"id":"406236","messageId":"20200924063829.GA1851751@coredump.intra.peff.net","threadId":"54276","inReplyTo":"CAD2jYq8OtHUpfUZyXC_+FHew45XEtgty3H-XF_2e30mb6kCCmw@mail.gmail.com","subject":"Re: git diff --name-only --submodule=diff combination does not work","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2020-09-24T06:38:29Z","receivedAt":"2020-09-24T06:38:33Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Sep 22, 2020 at 05:32:12PM -0400, Ilan Biala wrote:\n\n> I expected adding --submodule=diff to add all the filenames in\n> submodules that were modified, but the output just shows the submodule\n> folder name, not all the files within the submodule that were\n> modified.\n\nOK. That does sound like a useful thing to show, but AFAIK there is not\ncurrently a way to do so. Formats like --name-only and --raw are capable\nof showing a diff for the submodule entry itself, so they do. And we'd\nwant to continue to be able to do that even when the diff.submodule\nconfig option is set. So I suspect it would need to be something like\n--submodule=name-only. I.e., allowing any diff format to be passed\nthere.\n\n-Peff\n"}]}