git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [RFC][PATCH 0/2] submodule: port 'set-url' from shell to C
@ 2020-04-16 21:04 Shourya Shukla
  2020-04-16 21:04 ` [PATCH 1/2] submodule.c: update URL in .gitmodules using update_url_in_gitmodules Shourya Shukla
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Shourya Shukla @ 2020-04-16 21:04 UTC (permalink / raw)
  To: git
  Cc: christian.couder, peff, heba.waly, Johannes.Schindelin, gitster,
	Shourya Shukla

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


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-04-27 10:17 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-16 21:04 [RFC][PATCH 0/2] submodule: port 'set-url' from shell to C Shourya Shukla
2020-04-16 21:04 ` [PATCH 1/2] submodule.c: update URL in .gitmodules using update_url_in_gitmodules Shourya Shukla
2020-04-16 21:04 ` [PATCH 2/2] submodule: port subcommand 'set-url' from shell to C Shourya Shukla
2020-04-17 22:13   ` Christian Couder
2020-04-17 22:09 ` [RFC][PATCH 0/2] submodule: port " Christian Couder
2020-04-20  8:19 ` Denton Liu
2020-04-27  7:19   ` Shourya Shukla
2020-04-27 10:17     ` Denton Liu

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).