git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v3] [GSoC] submodule--helper: introduce add-clone subcommand

From
Atharva Raykar <raykar.ath@gmail.com>
Date
Jun 4, 2021, 11:16 UTC
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 <raykar.ath@gmail.com> wrote:
Show 33 quoted lines
> 
> 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 <raykar.ath@gmail.com>
> Mentored-by: Christian Couder <christian.couder@gmail.com>
> Mentored-by: Shourya Shukla <shouryashukla.oo@gmail.com>
> Based-on-patch-by: Shourya Shukla <shouryashukla.oo@gmail.com>
> Based-on-patch-by: Prathamesh Chavan <pc44800@gmail.com>
> ---
> 
> 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
Previous: Atharva RaykarNext: Shourya Shukla
Message 9 of 11 in “[GSoC] submodule: introduce add-clone helper for submodule add”
  1. [GSoC] submodule: introduce add-clone helper for submodule addAtharva Raykar, May 28, 2021
  2. Christian CouderJun 1, 2021
  3. Atharva RaykarJun 2, 2021
  4. Atharva RaykarJun 2, 2021
  5. [GSoC] submodule--helper: introduce add-clone subcommandAtharva Raykar, Jun 2, 2021
  6. Christian CouderJun 4, 2021
  7. Atharva RaykarJun 4, 2021
  8. [GSoC] submodule--helper: introduce add-clone subcommandAtharva Raykar, Jun 4, 2021
  9. Atharva RaykarJun 4, 2021
  10. Shourya ShuklaJun 4, 2021
  11. Atharva RaykarJun 4, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.