git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Enable parallelism in git submodule update.

From
Heiko Voigt <hvoigt@hvoigt.net>
Date
Jul 28, 2012, 10:52 UTC
Message-ID
<20120728105159.GB13370@book.hvoigt.net>
In-Reply-To
<7vk3xoyeex.fsf@alter.siamese.dyndns.org>
Hi,
On Fri, Jul 27, 2012 at 04:25:58PM -0700, Junio C Hamano wrote:
Show 26 quoted lines
> Stefan Zager <szager@google.com> writes:
> 
> > On Fri, Jul 27, 2012 at 2:38 PM, Junio C Hamano <gitster@pobox.com> wrote:
> >
> >> Stefan Zager <szager@google.com> writes:
> >>
> >> > +             module_list "$@" | awk '{print $4}' | xargs -L 1 -P
> >> "$jobs" git submodule update $orig_args
> >>
> >> Capital-P option to xargs is not even in POSIX, no?
> >
> > I wasn't aware of that, but you appear to be correct.  Don't know if you
> > have a policy about that, but anecdotally, -P is supported on my linux,
> > mac, and win/msys systems.
> 
> About "policy", we use POSIX as a rough yardstick to warn us that we
> might be breaking people on minority platforms.  We do _not_ say "It
> is in POSIX, so it is safe to use it", but we say "It is not even in
> POSIX, so we need to think twice."  We do not usually say "Linux,
> Mac and Windows are the only things that matter, and they all
> support it."
> 
> Of course, any set of rules have exceptions ;-) There are a few
> things to which we say "Even though it is not in POSIX, everybody
> who matters supports it, and without taking advantage of it, what we
> want to achieve will become too cumbersome to express".

I was about to write that since this is limited to a given --jobs options the majority platforms should be enough as a start and others could add a parallelism mechanism later. Its only a matter of efficiency and not features.

But if you look at my other post to this thread I described that we need some UI output extension so the user can still make sense of it. In short: The user should be able distinguish which job said what.

I was already thinking about how an output caching could be implemented in core git. How about exposing it as a git command like this?

	git run [-j<number>] ...

It works like the xargs call above except that it caches each jobs output to stderr and stdout until its done and then replays the output to stderr/out in the correct order.

We could design the code so that it can be reused later on to do the caching in parallel fetch/push/... .

What do you think? If we decide to go this route I would have a look into whipping something up.

Cheers Heiko
Previous: Junio C HamanoNext: Junio C Hamano
Message 11 of 12 in “Enable parallelism in git submodule update.”
  1. Enable parallelism in git submodule update.Stefan Zager, Jul 27, 2012
  2. Junio C HamanoJul 27, 2012
  3. Heiko VoigtJul 28, 2012
  4. cleanup argument passing in submodule status commandHeiko Voigt, Jul 28, 2012
  5. Junio C HamanoJul 29, 2012
  6. Jens LehmannJul 29, 2012
  7. Junio C HamanoJul 29, 2012
  8. Jens LehmannJul 29, 2012
  9. Jens LehmannNov 3, 2012
  10. Junio C HamanoJul 27, 2012
  11. Heiko VoigtJul 28, 2012
  12. Junio C HamanoJul 29, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.