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

Re: [GSoC] My Git Dev Blog – Week 8

From
Atharva Raykar <raykar.ath@gmail.com>
Date
Jul 19, 2021, 07:04 UTC
Message-ID
<C8229C5F-1F47-4D44-A6C0-B291AF9BF612@gmail.com>
In-Reply-To
<623770cb-d692-f61f-180a-33145caea97a@gmail.com>
On 18-Jul-2021, at 23:09, Kaartic Sivaraam <kaartic.sivaraam@gmail.com> wrote:
Show 26 quoted lines
> 
> Hi Atharva,
> 
> On 13/07/21 2:16 pm, Atharva Raykar wrote:
>> I was seeing if it was possible to at least save another spawn for calling
>> init when '--init' is provided for an update. The current implementation
>> does not spawn a separate process for this, so I was hoping I don't add
>> more overhead in the conversion, but it's looking hard to avoid at the
>> moment.
> 
> I'm having some difficulties understanding this. I tried to take a look
> at the existing code[2][3] in 'git-submodule.sh', I could only see that
> if '--init' is passed to update, it calls the 'cmd_update' shell function
> which in turn does invoke 'git submodule--helper init'. OTOH, if '--recursive'
> is passed 'cmd_update' itself is called recursively called after setting
> the 'prefix' and 'wt_prefix' shell variables.
> 
> So, I'm not sure how you mean to say that a sub-process was not spawned
> when '--init' is passed. Could you clarify this a little?
> 
>>> [1]: https://public-inbox.org/git/20180205235508.216277-1-sbeller@google.com/
>>> 
> 
> [2]: https://github.com/git/git/blob/abb21c7263616f01c5e950861a29279ab21cb02f/git-submodule.sh#L530-L533
> 
> [3]: https://github.com/git/git/blob/abb21c7263616f01c5e950861a29279ab21cb02f/git-submodule.sh#L651-L673

My mistake. When I wrote that paragraph, I had considered the shell call in my head to be "git submodule init" and not "git submodule--helper init".

In the former case, there would be an extra subprocess because 'submodule init' will in turn spawn 'submodule--helper init'. So in short, there would have been no difference between the two versions had I gone down that route.

Previous: Kaartic Sivaraam
Message 6 of 6 in “[GSoC] My Git Dev Blog – Week 8”
  1. Atharva RaykarJul 11, 2021
  2. Kaartic SivaraamJul 13, 2021
  3. Atharva RaykarJul 13, 2021
  4. Christian CouderJul 18, 2021
  5. Kaartic SivaraamJul 18, 2021
  6. Atharva RaykarJul 19, 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.