From: Atharva Raykar Date: Fri, 04 Jun 2021 11:16:06 GMT Subject: Re: [PATCH v3] [GSoC] submodule--helper: introduce add-clone subcommand Message-ID: <97DA3479-7E78-4EC8-BBD0-72869803E9D0@gmail.com> In-Reply-To: <20210604110524.84326-1-raykar.ath@gmail.com> On 04-Jun-2021, at 16:35, Atharva Raykar wrote: > > Let's add a new "add-clone" subcommand to `git submodule--helper` with > the goal of converting part of the shell code in git-submodule.sh > related to `git submodule add` into C code. This new subcommand clones > the repository that is to be added, and checks out to the appropriate > branch. > > This is meant to be a faithful conversion that leaves the behaviour of > 'submodule add' unchanged. The only minor change is that if a submodule name has > been supplied with a name that clashes with a local submodule, the message shown > to the user ("A git directory for 'foo' is found locally...") is prepended with > "error" for clarity. > > This is part of a series of changes that will result in all of 'submodule add' > being converted to C. > > Signed-off-by: Atharva Raykar > Mentored-by: Christian Couder > Mentored-by: Shourya Shukla > Based-on-patch-by: Shourya Shukla > Based-on-patch-by: Prathamesh Chavan > --- > > Changes since v2: > * Remove printf debug statement that was accidentally inserted into the final > patch > * Rename 'struct add_data info' to the more descriptive > 'struct add_data add_data' > * Remove unnecessary variables while parsing flags, and insert into the struct > members directly > * Eliminate extra heap allocation via 'xstrndup()' in parse_token() > (I learnt this trick from Junio's comment on Shourya's v2 review of a similar > patch :^) ) I forgot to mention, but this patch can be fetched via GitHub from: https://github.com/tfidfwastaken/git/tree/submodule-add-in-c-add-clone-v3