Re: [RFC][PATCH 0/2] submodule: port 'set-url' from shell to C
- From
Christian Couder <christian.couder@gmail.com>
- Date
- Apr 17, 2020, 22:09 UTC
- Message-ID
- <CAP8UFD1y7D_gSharBE9+CVyQKg3qhXMvtzBjkdYA1Aj3hocBMg@mail.gmail.com>
- In-Reply-To
- <20200416210456.19122-1-shouryashukla.oo@gmail.com>
Hi,
On Thu, Apr 16, 2020 at 11:05 PM Shourya Shukla <shouryashukla.oo@gmail.com> wrote:
Show 9 quoted lines
> 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'.
We usually don't add a function that is unused in the commit that adds it.
> 2. Port the function 'cmd_set_url()' in 'git-submodule.sh' to 'module_set_url()' > in 'submodule--helper.c'.
So it seems to me that you could squash the two commits into one.
Thanks, Christian.