git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Kaartic Sivaraam <kaartic.sivaraam@gmail.com>
To: Atharva Raykar <raykar.ath@gmail.com>
Cc: Git List <git@vger.kernel.org>,
	Christian Couder <christian.couder@gmail.com>,
	Shourya Shukla <periperidip@gmail.com>
Subject: Re: [GSoC] My Git Dev Blog – Week 8
Date: Tue, 13 Jul 2021 13:48:08 +0530	[thread overview]
Message-ID: <f5b12a75-bdaf-fe5c-ffc2-7b4c8cdfddd6@gmail.com> (raw)
In-Reply-To: <CD6968A1-179D-4B77-91C1-4EECB1B69951@gmail.com>

Hi Atharva,

On 11/07/21 4:48 pm, Atharva Raykar wrote:
> Here's my weekly update:
> https://atharvaraykar.me/gitnotes/week8
> 
> I am currently blocked by trying to pass a super-prefix parameter
> to another command, when calling it from within C.
>

 From the blog:

> When queried by the get_super_prefix() function, the answer is (null).
> This boggles my mind to no end (see update). The implementation is basically
> the same getenv() call?

Good to see that you were able to identify the reason yourself.

> I am not sure how to tell Git that the environment variable has in fact
> been modified, and that it needs to be reinitialized. Maybe I am going
> about this whole thing wrong?

I get the same feeling too. I took a brief look at how the issue could be
fixed and it seems to me that you exploring to set super-prefix might not
lead us to the solution. Alternatively, you could explore how other sub-commands
handle recursing into submodules. To me it looks like they handle it by spawning
a sub-process is likely the easiest approach for achieving recursion. That would
solve the super-prefix problem as you have observed.

Unfortunately, there's not yet proper support for handling recursion of submodules
which calls for working with the data of multiple Git repositories in the same
Git process. There was an effort[1] few years ago to make working with
other Git repositories simpler without having to spawn a sub-process. The state
of the effort is unclear to me. As far as I know, it has been stalled. I hope
others could provide more details about it.

So, you could try the approach of spawning of sub-process for now. In case there's
a better approach than spawning sub-process others might be able to point during
review. In the meanwhile, I'll try to take a better look later and see if I could
find anything.

[1]: https://public-inbox.org/git/20180205235508.216277-1-sbeller@google.com/

-- 
Sivaraam

  reply	other threads:[~2021-07-13  8:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-11 11:18 [GSoC] My Git Dev Blog – Week 8 Atharva Raykar
2021-07-13  8:18 ` Kaartic Sivaraam [this message]
2021-07-13  8:46   ` Atharva Raykar
2021-07-18  9:26     ` Christian Couder
2021-07-18 17:39     ` Kaartic Sivaraam
2021-07-19  7:04       ` Atharva Raykar

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=f5b12a75-bdaf-fe5c-ffc2-7b4c8cdfddd6@gmail.com \
    --to=kaartic.sivaraam@gmail.com \
    --cc=christian.couder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=periperidip@gmail.com \
    --cc=raykar.ath@gmail.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).