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>, Git List <git@vger.kernel.org>
Cc: Christian Couder <christian.couder@gmail.com>,
	Shourya Shukla <periperidip@gmail.com>
Subject: Re: My Git Dev Blog - Week 9
Date: Mon, 19 Jul 2021 08:28:34 +0530	[thread overview]
Message-ID: <a8122438-8d8b-9e7d-d66a-dc6eff7a0817@gmail.com> (raw)
In-Reply-To: <09edd920-e9ef-f8f9-79e6-d27badd2e5a6@gmail.com>

Hi Atharva and all,

On 19/07/21 12:49 am, Kaartic Sivaraam wrote:
> 
> On 18/07/21 5:29 pm, Atharva Raykar wrote:
> 
>> Passing the superprefix explicitly
> 
> My gut instinct tells me we could get away without having to go this way but
> I haven't yet been able to figure out how. How 'prefix', 'super-prefix' and
> 'recursive-prefix' is still puzzling me. In case anyone has knowledge about
> this please chime in and enlighten us. It would be very helpful.
>

I just noticed I was short and unhelpful here. To expand on what information would be
helpful on this respect, here's a snippet of a private e-mail I sent which I've
tweaked a little to make it relevant for the list audience:

-- 8< --
>> Problem:
>> -------
>> I cannot get 'submodule update --init --recursive' to work properly.
>> 
>> Cause:
>> -----
>> The paths get malformed in my first implementation[1] because I am not able
>> to transfer the git 'superprefix' to the 'init_submodule_cb' callback with the
>> current interface. The superprefix is required by the
>> 'get_submodule_displaypath()' function to create the correct display path.
>>
>> Thus, t406.5 fails.
>> 
>> For more details on this and the exact error,
>> cf.: https://atharvaraykar.me/gitnotes/week8#path-pains
>>
>> [ snip ]
>>
>> The link at [1] is the one where it fails only one test in my machine.
>>
>> [ snip ]
>>
>> This version does *not* start a subprocess for running init before the
>> update. The relevant lines for this are here:
>> https://github.com/tfidfwastaken/git/blob/7ad995f465072b60a8c33e51c4f91d08ee3d2484/builtin/submodule--helper.c#L3325-L3344
>>
>> [1]: https://github.com/tfidfwastaken/git/commits/submodule-helper-update-1b
>>

I took a look at this. I'm not able to find the exact issue but my gut instinct tells me
it has something to do with how prefix, super-prefix and recursive-prefix
are handled before and after the conversion. To be more specific, I'm having doubts
about whether the following code snippet[4] in shell ...

     prefix=$(git submodule--helper relative-path "$prefix$sm_path/" "$wt_prefix")
     wt_prefix=
     sanitize_submodule_env
     cd "$sm_path" &&
     eval cmd_update

... has been properly converted to C. Particularly, the fact that recursive calls to
'cmd_update' is made in the existing shell implementation in case '--recusive' is
passed needs to be observed well. This would subsequently result in multiple calls to
'cmd_init' with different 'prefix' and 'wt_prefix' values. So, that needs to be
observed well too.

I have not been able to get a complete picture of this myself. I'll try to take better
look later and see if I could get anything.

Note that this could also be me just not being able to get a proper picture of it.
Just wanted to share it in case others are able to get any ideas or able to think of a
possible cause.

[4]: https://github.com/git/git/blob/abb21c7263616f01c5e950861a29279ab21cb02f/git-submodule.sh#L654-L658
-- >8 --

I hope that gives a better idea about what kind of information would be helpful.
Kindly let me know if it doesn't.

Atharva,

In the meanwhile, I think you could continue polishing your attempted solution
and preparing to send it to the list. I'll try to dig more on my gut instinct
and let you know if I get anything. If you have some free time left after
polishing your series, you could try digging into it too :)

-- 
Sivaraam

  reply	other threads:[~2021-07-19  2:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-18 11:59 My Git Dev Blog - Week 9 Atharva Raykar
2021-07-18 13:15 ` Christian Couder
2021-07-19  8:57   ` Atharva Raykar
2021-07-18 19:19 ` Kaartic Sivaraam
2021-07-19  2:58   ` Kaartic Sivaraam [this message]
2021-07-19  8:48     ` Atharva Raykar
2021-07-19  0:51 ` Bagas Sanjaya
2021-07-19  8:53   ` 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=a8122438-8d8b-9e7d-d66a-dc6eff7a0817@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).