Hello all,
This is my very first attempt at the conversion of subcommand 'set-url' from shell to C, thus making the subcommand a builtin.
I have based my conversion by looking at the way other subcommands have been implemented in 'submodule--helper.c' as well as the subcommand 'set-url' in 'remote.c'. The approach I have taken is as follows:
1. Create a helper function 'update_url_in_gitmodules()' in 'submodule.c' to update the URL of an entry in '.gitmodules'.
2. Port the function 'cmd_set_url()' in 'git-submodule.sh' to 'module_set_url()' in 'submodule--helper.c'.
The issues I am facing are:
1. The patch fails test #2 in t7420, i.e., the test to verify the working of 'set-url' subcommand.
2. Though not an issue affecting the patch, but the 'usage' prompt of 'git submodule' does not show the subcommands 'set-url' and 'set-branch'.
Also, I am aware that the patch does not support the '--quiet' option. This is something I intended to add after ensuring that the patch works in the first place.
I understand that the patch is in a weak condition right now. How can this patch be improved? Any guidance from the community would be appreciated! :)
Thanks, Shourya Shukla
Shourya Shukla (2): submodule.c: update URL in .gitmodules using update_url_in_gitmodules submodule: port subcommand 'set-url' from shell to C
builtin/submodule--helper.c | 38 +++++++++++++++++++++++++++++++++++++ git-submodule.sh | 23 ++-------------------- submodule.c | 33 ++++++++++++++++++++++++++++++++ submodule.h | 2 ++ 4 files changed, 75 insertions(+), 21 deletions(-)
-- 2.20.1