From: Phil Hord <hidden> Date: 2016-06-15 22:55:03
I noticed that this is not supported:
git submodule sync --recursive
I do not see any discussion in the relevant commits about why it
cannot or should not be supported. Is it just an itch no one has
scratched?
Phil
I noticed that this is not supported:
git submodule sync --recursive
I do not see any discussion in the relevant commits about why it
cannot or should not be supported. Is it just an itch no one has
scratched?
I can't remember any discussions about that either, but can't
think of a reason why we shouldn't support that.
From: Phil Hord <hidden> Date: 2016-06-15 22:55:06
The submodule sync command was somehow left out when
--recursive was added to the other submodule commands.
Teach sync to handle the --recursive switch by recursing
when we're in a submodule we are sync'ing.
Change the report during sync to show submodule-path
instead of submodule-name to be consistent with the other
submodule commands and to help recursed paths make sense.
Signed-off-by: Phil Hord <redacted>
---
git-submodule.sh | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
From: Phil Hord <hidden> Date: 2016-06-15 22:55:06
[PATCH 1/2] Teach --recursive to submodule sync
[PATCH 2/2] Add tests for submodule sync --recursive
This series implements and tests git submodule sync --recursive
The submodule sync command was somehow left out when
--recursive was added to the other submodule commands.
Teach sync to handle the --recursive switch by recursing
when we're in a submodule we are sync'ing.
Change the report during sync to show submodule-path
instead of submodule-name to be consistent with the other
submodule commands and to help recursed paths make sense.
Signed-off-by: Phil Hord <redacted>
This makes perfect sense to me. Two things though:
First it would be nice to initialize orig_flags like all the other
call sites do:
@@ -1003,6 +1003,7 @@ cmd_status() # cmd_sync() {+ orig_flags= while test $# -ne 0 do case "$1" in
This should read 'eval cmd_sync "$orig_flags"'. I think you copied that
from cmd_status(), where this is also incorrect, I just sent a patch to
correct that one.
From: Phil Hord <hidden> Date: 2016-06-15 22:55:07
Jens Lehmann wrote:
quoted hunk
Am 24.10.2012 01:15, schrieb Phil Hord:
quoted
The submodule sync command was somehow left out when
--recursive was added to the other submodule commands.
Teach sync to handle the --recursive switch by recursing
when we're in a submodule we are sync'ing.
Change the report during sync to show submodule-path
instead of submodule-name to be consistent with the other
submodule commands and to help recursed paths make sense.
Signed-off-by: Phil Hord <redacted>
This makes perfect sense to me. Two things though:
First it would be nice to initialize orig_flags like all the other
call sites do:
@@ -1003,6 +1003,7 @@ cmd_status() # cmd_sync() {+ orig_flags= while test $# -ne 0 do case "$1" in
This should read 'eval cmd_sync "$orig_flags"'. I think you copied that
from cmd_status(), where this is also incorrect, I just sent a patch to
correct that one.
Yes, thanks for catching that. I think I should add a test for that
except I notice that sync doesn't take any other flags useful for passing.
v2 is on the way.
From: Phil Hord <hidden> Date: 2016-06-15 22:55:07
The submodule sync command was somehow left out when
--recursive was added to the other submodule commands.
Teach sync to handle the --recursive switch by recursing
when we're in a submodule we are sync'ing.
Change the report during sync to show submodule-path
instead of submodule-name to be consistent with the other
submodule commands and to help recursed paths make sense.
Signed-off-by: Phil Hord <redacted>
---
git-submodule.sh | 19 ++++++++++++++++---
1 file changed, 16 insertions(+), 3 deletions(-)
On Fri, Oct 26, 2012 at 1:19 PM, Phil Hord [off-list ref] wrote:
quoted
Yes, thanks for catching that. I think I should add a test for that
except I notice that sync doesn't take any other flags useful for passing.
Which, of course, suggests that I should not add this
flag-propagating-machinery to submodule-sync at all. yes?
Nope, the new --recursive option has to be passed on!
To catch that bug in your test you'd need another submodule inside your
sub-submodule. The first level submodule is initialized by sync anyways,
the sub-submodule is initialized by the --recursive logic you added but
the sub-sub-submodule would not have been synced because the option was
dropped. I really can't blame you for not adding that third level of
submodules ;-)