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

Re: [WIP/PATCH 3/3] submodule: helper to run foreach in parallel

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 21, 2015, 19:23 UTC
Message-ID
<xmqq7foo5tty.fsf@gitster.dls.corp.google.com>
In-Reply-To
<1440121237-24576-3-git-send-email-sbeller@google.com>
Stefan Beller <sbeller@google.com> writes:
Show 10 quoted lines
> +struct submodule_args {
> +	const char *name;
> +	const char *path;
> +	const char *sha1;
> +	const char *toplevel;
> +	const char *prefix;
> +	const char **cmd;
> +	struct submodule_output *out;
> +	sem_t *mutex;
> +};

I do not see what submodule_output looks like in the patch, but I guess you are capturing _all_ output from a task and emitting everything at the end, after the task is done?

I have to wonder if that is what people would expect and more importantly if that is the most useful. I am sympathetic to the desire to avoid the output totally mixed up from different processes emitting things in an uncoordinated manner, and "slurp everything and then show everything in one go" is certainly _one_ way to do so, but early feedback also counts. Besides, because the order in which tasks are dispatched and completed is unpredictable, you cannot expect a machine parseable output _without_ assuming some help from the command invoked by each task (e.g. by prefixing the task's output with some string that identifies which submodule the output is about).

Once you assume that the command is _aware_ that it needs to help the foreach-parallel infrastructure so that the user can sift their collective outputs to make sense of them, wouldn't a line-buffered intermixing also acceptable, and wouldn't it be a much lower impact approach to solve the same problem?

Previous: Stefan BellerNext: Stefan Beller
Message 15 of 16 in “submodule: implement `module_clone` as a builtin helper”
  1. 1/3 submodule: implement `module_clone` as a builtin helperStefan Beller, Aug 21, 2015
  2. 2/3 run-commands: add an async queue processorStefan Beller, Aug 21, 2015
  3. Junio C HamanoAug 21, 2015
  4. Jeff KingAug 21, 2015
  5. Stefan BellerAug 21, 2015
  6. Jeff KingAug 21, 2015
  7. Stefan BellerAug 21, 2015
  8. Junio C HamanoAug 21, 2015
  9. Stefan BellerAug 21, 2015
  10. Junio C HamanoAug 24, 2015
  11. Stefan BellerAug 21, 2015
  12. Junio C HamanoAug 21, 2015
  13. Stefan BellerAug 21, 2015
  14. 3/3 submodule: helper to run foreach in parallelStefan Beller, Aug 21, 2015
  15. Junio C HamanoAug 21, 2015
  16. Stefan BellerAug 21, 2015

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.