git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: Jonas Bernoulli <jonas@bernoul.li>, git@vger.kernel.org
Subject: Re: "submodule foreach" much slower than removed "submodule--helper --list"
Date: Sat, 15 Oct 2022 15:40:16 -0700	[thread overview]
Message-ID: <xmqqwn904sof.fsf@gitster.g> (raw)
In-Reply-To: <Y0r4US7AKxT/BLiY@coredump.intra.peff.net> (Jeff King's message of "Sat, 15 Oct 2022 14:13:37 -0400")

Jeff King <peff@peff.net> writes:

>   - the output of the old "submodule--helper list" looks a lot like
>     "ls-files" dumping the index and filtering on submodule entries.
>     Running:
>
>        git ls-files -s | grep ^160000
>
>     produces the same output.

Indeed that was what we wrote in the scripted Porcelain.  This is
one of the times I wish we didn't turn things to C in piecemeal.

> I'm not sure if those are exactly equivalent, either. It looks like the
> old code was probably respecting submodule active markers (though in my
> test repo without the submodule actually checked out, it's still
> reported).

"submodule--helper list" being the "give me the gitlinks", to be
filtered with things like pathspec and presence of .git (i.e. being
activated), you are right that those who liked the output from it
would not be happy with "foreach" anyway.  The comparison in the
original was apples and oranges because "foreach" should show only
the ones that are active in the current checkout.

If one likes the output from "submodule--helper list" so much, I
think your "ls-files" above should be the closest.  There seems to
have existed some logic to squash unmerged entries down to a single
one, too (git-submodule.sh in Git 2.0.0 era has a module_list shell
function that shows what "helper list" should be doing), though.

Thanks.


  parent reply	other threads:[~2022-10-15 22:40 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-15 16:50 "submodule foreach" much slower than removed "submodule--helper --list" Jonas Bernoulli
2022-10-15 17:34 ` Jonas Bernoulli
2022-10-15 18:13   ` Jeff King
2022-10-15 18:16     ` Junio C Hamano
2022-10-15 18:23       ` Jeff King
2022-10-15 18:37         ` Junio C Hamano
2022-10-15 22:40     ` Junio C Hamano [this message]
2022-10-17 17:02       ` Jeff King
2022-11-07 11:01       ` Matti Möll
2022-11-08  2:50         ` Taylor Blau
2022-11-08  3:37           ` Ævar Arnfjörð Bjarmason
2022-10-17 16:50   ` Ævar Arnfjörð Bjarmason
2022-10-17 17:46     ` Jeff King
2022-10-21 14:58     ` Jonas Bernoulli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqwn904sof.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=jonas@bernoul.li \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).