Thread (2 messages) flat view 2 messages, 2 authors, 2016-06-15

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

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:54:58

Junio C Hamano [off-list ref] writes:
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?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help