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

Re: [PATCH] submodule: teach "foreach" command a --revision <tree-ish> option

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 9, 2012, 06:12 UTC
Message-ID
<7v4nm4i37u.fsf@alter.siamese.dyndns.org>
In-Reply-To
<7v8vbgi3yz.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
Show 6 quoted lines
> Assuming that the above guess is correct (which is a huge
> assumption, given the lack of clarity in the description), I think
> the feature might make sense.  The example would have been a lot
> easier to follow if it were something like this:
>
>     $ git submodule foreach --revision v1.0 'git grep -e frotz $sha1'

Imagine you have a checkout of v2.0 of the superproject in your working tree, and you run "git submodule foreach --revision v1.0". Further imagine a submodule S that used to exist back when the superproject was at v1.0 no longer exists in the current codebase (hence there is no such submodule in the working tree).

Shouldn't the above "foreach ... grep" still try to find 'frotz' in the submodule S that was bound to v1.0 of the superproject?

Given that your patch does not touch the part of cmd_foreach where it decides which submodule to descend into, it still will base its decision solely on the set of submodules that are bound to and have been "git submodule init"ed in the version of the superproject that is _currently_ checked out, no?

Previous: Junio C HamanoNext: Jay Soffian
Message 3 of 8 in “submodule: teach "foreach" command a --revision <tree-ish> option”
  1. submodule: teach "foreach" command a --revision <tree-ish> optionJay Soffian, Oct 9, 2012
  2. Junio C HamanoOct 9, 2012
  3. Junio C HamanoOct 9, 2012
  4. Jay SoffianOct 9, 2012
  5. Junio C HamanoOct 9, 2012
  6. Jens LehmannOct 9, 2012
  7. Jay SoffianOct 9, 2012
  8. Junio C HamanoOct 9, 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.