git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shourya Shukla <shouryashukla.oo@gmail.com>
To: git@vger.kernel.org
Cc: christian.couder@gmail.com, peff@peff.net, heba.waly@gmail.com,
	Johannes.Schindelin@gmx.de, gitster@pobox.com,
	Shourya Shukla <shouryashukla.oo@gmail.com>
Subject: [RFC][PATCH 0/2] submodule: port 'set-url' from shell to C
Date: Fri, 17 Apr 2020 02:34:54 +0530	[thread overview]
Message-ID: <20200416210456.19122-1-shouryashukla.oo@gmail.com> (raw)

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


             reply	other threads:[~2020-04-16 21:05 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-16 21:04 Shourya Shukla [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200416210456.19122-1-shouryashukla.oo@gmail.com \
    --to=shouryashukla.oo@gmail.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=christian.couder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=heba.waly@gmail.com \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).