git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* git diff --name-only --submodule=diff combination does not work
       [not found] <20200922193407.23931C0613CF@lindbergh.monkeyblade.net>
@ 2020-09-22 20:56 ` Ilan Biala
  2020-09-22 21:24   ` Jeff King
  0 siblings, 1 reply; 4+ messages in thread
From: Ilan Biala @ 2020-09-22 20:56 UTC (permalink / raw)
  To: git

Hi,

I've been running into issues with using the --name-only and
--submodule=diff flags together in Git 2.27.0. Is this a known bug?

Thanks,
Ilan

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: git diff --name-only --submodule=diff combination does not work
  2020-09-22 20:56 ` git diff --name-only --submodule=diff combination does not work Ilan Biala
@ 2020-09-22 21:24   ` Jeff King
  2020-09-22 21:32     ` Ilan Biala
  0 siblings, 1 reply; 4+ messages in thread
From: Jeff King @ 2020-09-22 21:24 UTC (permalink / raw)
  To: Ilan Biala; +Cc: git

On Tue, Sep 22, 2020 at 04:56:45PM -0400, Ilan Biala wrote:

> I've been running into issues with using the --name-only and
> --submodule=diff flags together in Git 2.27.0. Is this a known bug?

What did you expect it to do, and what did it do instead?

I'm not very familiar with the --submodule flag, but it looks like it
only impacts "--patch" output. E.g., in git.git (with the submodule
actually populated):

  $ git log --oneline --submodule=diff -p sha1collisiondetection
  4125f78222 sha1dc: update from upstream
  Submodule sha1collisiondetection 16033998da..855827c583:
    > Detect endianess on HP-UX
  07a20f569b Makefile: fix unaligned loads in sha1dc with UBSan
  Submodule sha1collisiondetection 232357eb2e..16033998da:
    > Shorter version of force aligned access.
    > Add compiler option to force aligned access even for Intel CPUs.
  23e37f8e9d sha1dc: update from upstream
  Submodule sha1collisiondetection 19d97bf5af..232357eb2e:
    > Merge pull request #45 from avar/aix-big-endian-detection
    > sha1c: fix a trivial spelling error
  86cfd61e6b sha1dc: optionally use sha1collisiondetection as a submodule
  Submodule sha1collisiondetection 0000000000...19d97bf5af (new submodule)

  $ git log --oneline --submodule=log --raw sha1collisiondetection
  4125f78222 sha1dc: update from upstream
  :160000 160000 16033998da 855827c583 M  sha1collisiondetection
  07a20f569b Makefile: fix unaligned loads in sha1dc with UBSan
  :160000 160000 232357eb2e 16033998da M  sha1collisiondetection
  23e37f8e9d sha1dc: update from upstream
  :160000 160000 19d97bf5af 232357eb2e M  sha1collisiondetection
  86cfd61e6b sha1dc: optionally use sha1collisiondetection as a submodule
  :000000 160000 0000000000 19d97bf5af A  sha1collisiondetection

-Peff

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: git diff --name-only --submodule=diff combination does not work
  2020-09-22 21:24   ` Jeff King
@ 2020-09-22 21:32     ` Ilan Biala
  2020-09-24  6:38       ` Jeff King
  0 siblings, 1 reply; 4+ messages in thread
From: Ilan Biala @ 2020-09-22 21:32 UTC (permalink / raw)
  To: Jeff King; +Cc: git

I expected adding --submodule=diff to add all the filenames in
submodules that were modified, but the output just shows the submodule
folder name, not all the files within the submodule that were
modified.

On Tue, Sep 22, 2020 at 5:24 PM Jeff King <peff@peff.net> wrote:
>
> On Tue, Sep 22, 2020 at 04:56:45PM -0400, Ilan Biala wrote:
>
> > I've been running into issues with using the --name-only and
> > --submodule=diff flags together in Git 2.27.0. Is this a known bug?
>
> What did you expect it to do, and what did it do instead?
>
> I'm not very familiar with the --submodule flag, but it looks like it
> only impacts "--patch" output. E.g., in git.git (with the submodule
> actually populated):
>
>   $ git log --oneline --submodule=diff -p sha1collisiondetection
>   4125f78222 sha1dc: update from upstream
>   Submodule sha1collisiondetection 16033998da..855827c583:
>     > Detect endianess on HP-UX
>   07a20f569b Makefile: fix unaligned loads in sha1dc with UBSan
>   Submodule sha1collisiondetection 232357eb2e..16033998da:
>     > Shorter version of force aligned access.
>     > Add compiler option to force aligned access even for Intel CPUs.
>   23e37f8e9d sha1dc: update from upstream
>   Submodule sha1collisiondetection 19d97bf5af..232357eb2e:
>     > Merge pull request #45 from avar/aix-big-endian-detection
>     > sha1c: fix a trivial spelling error
>   86cfd61e6b sha1dc: optionally use sha1collisiondetection as a submodule
>   Submodule sha1collisiondetection 0000000000...19d97bf5af (new submodule)
>
>   $ git log --oneline --submodule=log --raw sha1collisiondetection
>   4125f78222 sha1dc: update from upstream
>   :160000 160000 16033998da 855827c583 M  sha1collisiondetection
>   07a20f569b Makefile: fix unaligned loads in sha1dc with UBSan
>   :160000 160000 232357eb2e 16033998da M  sha1collisiondetection
>   23e37f8e9d sha1dc: update from upstream
>   :160000 160000 19d97bf5af 232357eb2e M  sha1collisiondetection
>   86cfd61e6b sha1dc: optionally use sha1collisiondetection as a submodule
>   :000000 160000 0000000000 19d97bf5af A  sha1collisiondetection
>
> -Peff

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: git diff --name-only --submodule=diff combination does not work
  2020-09-22 21:32     ` Ilan Biala
@ 2020-09-24  6:38       ` Jeff King
  0 siblings, 0 replies; 4+ messages in thread
From: Jeff King @ 2020-09-24  6:38 UTC (permalink / raw)
  To: Ilan Biala; +Cc: git

On Tue, Sep 22, 2020 at 05:32:12PM -0400, Ilan Biala wrote:

> I expected adding --submodule=diff to add all the filenames in
> submodules that were modified, but the output just shows the submodule
> folder name, not all the files within the submodule that were
> modified.

OK. That does sound like a useful thing to show, but AFAIK there is not
currently a way to do so. Formats like --name-only and --raw are capable
of showing a diff for the submodule entry itself, so they do. And we'd
want to continue to be able to do that even when the diff.submodule
config option is set. So I suspect it would need to be something like
--submodule=name-only. I.e., allowing any diff format to be passed
there.

-Peff

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-09-24  6:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20200922193407.23931C0613CF@lindbergh.monkeyblade.net>
2020-09-22 20:56 ` git diff --name-only --submodule=diff combination does not work Ilan Biala
2020-09-22 21:24   ` Jeff King
2020-09-22 21:32     ` Ilan Biala
2020-09-24  6:38       ` Jeff King

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).