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

Re: [PATCH/RFC] Changing submodule foreach --recursive to be depth-first, --parent option to execute command in supermodule as well

From
Heiko Voigt <hvoigt@hvoigt.net>
Date
Mar 5, 2013, 07:59 UTC
Message-ID
<20130305075901.GB4677@sandbox-ub>
In-Reply-To
<7vhakqwz1e.fsf@alter.siamese.dyndns.org>
On Mon, Mar 04, 2013 at 03:00:45PM -0800, Junio C Hamano wrote:
Show 6 quoted lines
> So if you want a single boolean to toggle between the current
> behaviour and the other one, it would be --post-order.  But you may
> at least want to consider pros and cons of allowing users to give
> two separate commands, one for the pre-order visitation (which is
> the current "command") and the other for the post-order
> visitation. Being able to run both might turn out to be useful.

I second that. Having a --post-order=<command/script> switch will give us much more flexibility. For ease of use we could allow --post-order without command to switch the meaning of the main command.

So a final solution would have these switches:
git submodule foreach ... [--pre-order[=<command>]] [--post-order[=<command>]] [<command>]

If only --pre-order without argument is given the command will be executed pre-order. If only --post-order the command will be executed post-order. If both are given its an error and so on...

There are some combinations we would need to catch as errors but this design should allow a step by step implementation:

	1. just the --post-order switch
	2. --post-order with argument switch
	3. --pre-order (including argument) for symmetry of usage
Cheers Heiko
Previous: Eric CousineauNext: Junio C Hamano
Message 5 of 25 in “Changing submodule foreach --recursive to be depth-first, --parent option to execute command in supermodule as well”
  1. Changing submodule foreach --recursive to be depth-first, --parent option to execute command in supermodule as wellEric Cousineau, Mar 4, 2013
  2. Jens LehmannMar 4, 2013
  3. Junio C HamanoMar 4, 2013
  4. Eric CousineauMar 5, 2013
  5. Heiko VoigtMar 5, 2013
  6. Junio C HamanoMar 5, 2013
  7. Eric CousineauMar 5, 2013
  8. Junio C HamanoMar 5, 2013
  9. Jens LehmannMar 5, 2013
  10. Phil HordMar 5, 2013
  11. Jens LehmannMar 9, 2013
  12. Heiko VoigtMar 11, 2013
  13. Phil HordMar 12, 2013
  14. Eric CousineauMar 14, 2013
  15. Jens LehmannMar 18, 2013
  16. Eric CousineauMar 26, 2013
  17. Jens LehmannApr 2, 2013
  18. submodule foreach: Added in --post-order=<command> and adjusted code per Jens Lehmann's suggestionseacousineau, Apr 13, 2013
  19. Jens LehmannApr 14, 2013
  20. Jens LehmannMar 18, 2013
  21. Eric CousineauMar 26, 2013
  22. Eric CousineauMar 26, 2013
  23. Junio C HamanoMar 26, 2013
  24. Junio C HamanoMar 26, 2013
  25. Eric CousineauApr 13, 2013

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.