{"thread":{"id":"56123","subject":"My Git Dev Blog - Week 9","startedAt":"2021-07-18T11:59:28Z","lastAt":"2021-07-19T09:01:15Z","messageCount":8,"participants":["Atharva Raykar","Christian Couder","Kaartic Sivaraam","Bagas Sanjaya"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"430463","messageId":"ED260A04-153A-46D5-8A84-CF517085DEC9@gmail.com","threadId":"56123","inReplyTo":null,"subject":"My Git Dev Blog - Week 9","fromName":"Atharva Raykar","fromEmail":"raykar.ath@gmail.com","sentAt":"2021-07-18T11:59:22Z","receivedAt":"2021-07-18T11:59:28Z","isPatch":false,"sender":{"key":"raykar.ath@gmail.com","avatar":"https://avatars.githubusercontent.com/u/24277692?v=4"},"body":"Here's my latest blog post:\nhttps://atharvaraykar.me/gitnotes/week9\n\nA part that may be interesting to list readers:\n\n- In one section of the blog, I describe the problem of the git\n  submodule configuration not updating properly, when I launch\n  a subprocess that first initialises the submodule. I will\n  appreciate it if someone has a possible explanation for the\n  issue I faced at:\n  https://atharvaraykar.me/gitnotes/week9#launching-the-init-part-as-a-subprocess\n\nThe rest of the post talks about my project progress so far, and how I\navoided the above problem entirely for now by taking a different approach.\n\nHave a great day!\n\n---\nAtharva Raykar\nಅಥರ್ವ ರಾಯ್ಕರ್\nअथर्व रायकर\n\n"},{"id":"430465","messageId":"CAP8UFD0NCQ5w_3GtT_xHr35i7h8BuLX4UcHNY6VHPGREmDVObA@mail.gmail.com","threadId":"56123","inReplyTo":"ED260A04-153A-46D5-8A84-CF517085DEC9@gmail.com","subject":"Re: My Git Dev Blog - Week 9","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2021-07-18T13:15:35Z","receivedAt":"2021-07-18T13:15:49Z","isPatch":false,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"On Sun, Jul 18, 2021 at 1:59 PM Atharva Raykar <raykar.ath@gmail.com> wrote:\n>\n> Here's my latest blog post:\n> https://atharvaraykar.me/gitnotes/week9\n\nGreat!\n\n> A part that may be interesting to list readers:\n>\n> - In one section of the blog, I describe the problem of the git\n>   submodule configuration not updating properly, when I launch\n>   a subprocess that first initialises the submodule. I will\n>   appreciate it if someone has a possible explanation for the\n>   issue I faced at:\n>   https://atharvaraykar.me/gitnotes/week9#launching-the-init-part-as-a-subprocess\n\nMy wild guess about why is_submodule_active() might not be working as\nexpected is that submodule_from_path() uses the submodule cache which\nmight not be properly updated when a submodule is initialized by a\nsubprocess.\n\n> The rest of the post talks about my project progress so far, and how I\n> avoided the above problem entirely for now by taking a different approach.\n\nNice that you found a possible better way!\n"},{"id":"430468","messageId":"09edd920-e9ef-f8f9-79e6-d27badd2e5a6@gmail.com","threadId":"56123","inReplyTo":"ED260A04-153A-46D5-8A84-CF517085DEC9@gmail.com","subject":"Re: My Git Dev Blog - Week 9","fromName":"Kaartic Sivaraam","fromEmail":"kaartic.sivaraam@gmail.com","sentAt":"2021-07-18T19:19:29Z","receivedAt":"2021-07-18T19:19:49Z","isPatch":false,"sender":{"key":"kaartic.sivaraam@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12448084?v=4"},"body":"Hi Atharva and all,\n\nOn 18/07/21 5:29 pm, Atharva Raykar wrote:\n> Here's my latest blog post:\n> https://atharvaraykar.me/gitnotes/week9\n> \n\nNice blog!\n\n> A part that may be interesting to list readers:\n> \n> - In one section of the blog, I describe the problem of the git\n>    submodule configuration not updating properly, when I launch\n>    a subprocess that first initialises the submodule. I will\n>    appreciate it if someone has a possible explanation for the\n>    issue I faced at:\n>    https://atharvaraykar.me/gitnotes/week9#launching-the-init-part-as-a-subprocess\n> \n\nChristian mentioned a possible reason. I'll try to take a look\nlater and see if I could find anything.\n\n> Passing the superprefix explicitly\n\nMy gut instinct tells me we could get away without having to go this way but\nI haven't yet been able to figure out how. How 'prefix', 'super-prefix' and\n'recursive-prefix' is still puzzling me. In case anyone has knowledge about\nthis please chime in and enlighten us. It would be very helpful.\n\n> I am also waiting on my list patch to land on master, so that I can\n> then send the next patch for the submodule add conversion.\n\nI think you don't have to wait until it lands on 'master'. Now that it\nis set to merge to 'next', I believe it should be fine for you to send\nthe rest of the series to the list. Just make sure you mention the\ndependency of the series on the one you've already sent to the list.\n\n> Have a great day!\n>\n\nThanks! Hope you have a great weak ahead and do well in your exams.\n\n-- \nSivaraam\n"},{"id":"430469","messageId":"fcb14e9b-c76d-9a54-fccb-d66e7de04f7a@gmail.com","threadId":"56123","inReplyTo":"ED260A04-153A-46D5-8A84-CF517085DEC9@gmail.com","subject":"Re: My Git Dev Blog - Week 9","fromName":"Bagas Sanjaya","fromEmail":"bagasdotme@gmail.com","sentAt":"2021-07-19T00:51:17Z","receivedAt":"2021-07-19T00:51:28Z","isPatch":false,"sender":{"key":"bagasdotme@gmail.com","avatar":"https://avatars.githubusercontent.com/u/40219486?v=4"},"body":"On 18/07/21 18.59, Atharva Raykar wrote:\n> Here's my latest blog post:\n> https://atharvaraykar.me/gitnotes/week9\n\nYou wrote:\n> Interact more with the community by asking questions in your patch cover letters and replies to reviews.\n\nDid you mean something like [RFC PATCH]?\n\n-- \nAn old man doll... just what I always wanted! - Clara\n"},{"id":"430470","messageId":"a8122438-8d8b-9e7d-d66a-dc6eff7a0817@gmail.com","threadId":"56123","inReplyTo":"09edd920-e9ef-f8f9-79e6-d27badd2e5a6@gmail.com","subject":"Re: My Git Dev Blog - Week 9","fromName":"Kaartic Sivaraam","fromEmail":"kaartic.sivaraam@gmail.com","sentAt":"2021-07-19T02:58:34Z","receivedAt":"2021-07-19T02:58:48Z","isPatch":false,"sender":{"key":"kaartic.sivaraam@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12448084?v=4"},"body":"Hi Atharva and all,\n\nOn 19/07/21 12:49 am, Kaartic Sivaraam wrote:\n> \n> On 18/07/21 5:29 pm, Atharva Raykar wrote:\n> \n>> Passing the superprefix explicitly\n> \n> My gut instinct tells me we could get away without having to go this way but\n> I haven't yet been able to figure out how. How 'prefix', 'super-prefix' and\n> 'recursive-prefix' is still puzzling me. In case anyone has knowledge about\n> this please chime in and enlighten us. It would be very helpful.\n>\n\nI just noticed I was short and unhelpful here. To expand on what information would be\nhelpful on this respect, here's a snippet of a private e-mail I sent which I've\ntweaked a little to make it relevant for the list audience:\n\n-- 8< --\n>> Problem:\n>> -------\n>> I cannot get 'submodule update --init --recursive' to work properly.\n>> \n>> Cause:\n>> -----\n>> The paths get malformed in my first implementation[1] because I am not able\n>> to transfer the git 'superprefix' to the 'init_submodule_cb' callback with the\n>> current interface. The superprefix is required by the\n>> 'get_submodule_displaypath()' function to create the correct display path.\n>>\n>> Thus, t406.5 fails.\n>> \n>> For more details on this and the exact error,\n>> cf.: https://atharvaraykar.me/gitnotes/week8#path-pains\n>>\n>> [ snip ]\n>>\n>> The link at [1] is the one where it fails only one test in my machine.\n>>\n>> [ snip ]\n>>\n>> This version does *not* start a subprocess for running init before the\n>> update. The relevant lines for this are here:\n>> https://github.com/tfidfwastaken/git/blob/7ad995f465072b60a8c33e51c4f91d08ee3d2484/builtin/submodule--helper.c#L3325-L3344\n>>\n>> [1]: https://github.com/tfidfwastaken/git/commits/submodule-helper-update-1b\n>>\n\nI took a look at this. I'm not able to find the exact issue but my gut instinct tells me\nit has something to do with how prefix, super-prefix and recursive-prefix\nare handled before and after the conversion. To be more specific, I'm having doubts\nabout whether the following code snippet[4] in shell ...\n\n     prefix=$(git submodule--helper relative-path \"$prefix$sm_path/\" \"$wt_prefix\")\n     wt_prefix=\n     sanitize_submodule_env\n     cd \"$sm_path\" &&\n     eval cmd_update\n\n... has been properly converted to C. Particularly, the fact that recursive calls to\n'cmd_update' is made in the existing shell implementation in case '--recusive' is\npassed needs to be observed well. This would subsequently result in multiple calls to\n'cmd_init' with different 'prefix' and 'wt_prefix' values. So, that needs to be\nobserved well too.\n\nI have not been able to get a complete picture of this myself. I'll try to take better\nlook later and see if I could get anything.\n\nNote that this could also be me just not being able to get a proper picture of it.\nJust wanted to share it in case others are able to get any ideas or able to think of a\npossible cause.\n\n[4]: https://github.com/git/git/blob/abb21c7263616f01c5e950861a29279ab21cb02f/git-submodule.sh#L654-L658\n-- >8 --\n\nI hope that gives a better idea about what kind of information would be helpful.\nKindly let me know if it doesn't.\n\nAtharva,\n\nIn the meanwhile, I think you could continue polishing your attempted solution\nand preparing to send it to the list. I'll try to dig more on my gut instinct\nand let you know if I get anything. If you have some free time left after\npolishing your series, you could try digging into it too :)\n\n-- \nSivaraam\n"},{"id":"430478","messageId":"6A97A724-4B80-4DDC-B5D2-83F8AD0B27EF@gmail.com","threadId":"56123","inReplyTo":"a8122438-8d8b-9e7d-d66a-dc6eff7a0817@gmail.com","subject":"Re: My Git Dev Blog - Week 9","fromName":"Atharva Raykar","fromEmail":"raykar.ath@gmail.com","sentAt":"2021-07-19T08:48:50Z","receivedAt":"2021-07-19T08:57:46Z","isPatch":false,"sender":{"key":"raykar.ath@gmail.com","avatar":"https://avatars.githubusercontent.com/u/24277692?v=4"},"body":"On 19-Jul-2021, at 08:28, Kaartic Sivaraam <kaartic.sivaraam@gmail.com> wrote:\n> \n> Hi Atharva and all,\n> \n> On 19/07/21 12:49 am, Kaartic Sivaraam wrote:\n>> On 18/07/21 5:29 pm, Atharva Raykar wrote:\n>>> Passing the superprefix explicitly\n>> My gut instinct tells me we could get away without having to go this way but\n>> I haven't yet been able to figure out how. How 'prefix', 'super-prefix' and\n>> 'recursive-prefix' is still puzzling me. In case anyone has knowledge about\n>> this please chime in and enlighten us. It would be very helpful.\n>> \n> \n> I just noticed I was short and unhelpful here. To expand on what information would be\n> helpful on this respect, here's a snippet of a private e-mail I sent which I've\n> tweaked a little to make it relevant for the list audience:\n> \n> -- 8< --\n>>> ...\n>>> \n> \n> I took a look at this. I'm not able to find the exact issue but my gut instinct tells me\n> it has something to do with how prefix, super-prefix and recursive-prefix\n> are handled before and after the conversion. To be more specific, I'm having doubts\n> about whether the following code snippet[4] in shell ...\n> \n>    prefix=$(git submodule--helper relative-path \"$prefix$sm_path/\" \"$wt_prefix\")\n>    wt_prefix=\n>    sanitize_submodule_env\n>    cd \"$sm_path\" &&\n>    eval cmd_update\n> \n> ... has been properly converted to C. Particularly, the fact that recursive calls to\n> 'cmd_update' is made in the existing shell implementation in case '--recusive' is\n> passed needs to be observed well. This would subsequently result in multiple calls to\n> 'cmd_init' with different 'prefix' and 'wt_prefix' values. So, that needs to be\n> observed well too.\n\nThe whole deal with prefixes confused me initially a lot as well, so I'll try to\nexplain what's going on there first, and then show why I had trouble with it.\n\nThe terminology of 'recursive-prefix' was something I borrowed from the update-clone\nhelper[5]. Just to give you a summary of which shell variable maps to which C\nvariable, along with my understanding of what they represent:\n\n| shell      | C                | description                               |\n|------------+------------------+-------------------------------------------|\n| $prefix    | recursive_prefix | this represents the superproject prefix,  |\n|            |                  | ie, the path of the superproject relative |\n|            |                  | to the current subproject.                |\n|            |                  |                                           |\n| $wt_prefix | prefix           | this is the path into the working tree,   |\n|            |                  | ie, the path of the directory from the    |\n|            |                  | root of the git directory's worktree      |\n\nThe display paths that are generated for the error messages require one of these to\nbe non-NULL, but not both[6].\n\nI feel confident the values of the various prefixes are handled properly during the\nrecursion because I setup a new worktree on based master as my \"control\", and a\ncombination of running with GIT_TRACE2 and printing the values showed me that both\nof them handle the prefixes identically.\n\nThe issue with the subprocess approach[7] seems to be not with the prefixes, but\nrather with the configuration not being properly read when it is set in the same\ncommand invocation.\n\n[5] https://github.com/git/git/blob/75ae10bc75336db031ee58d13c5037b929235912/git-submodule.sh#L536-L550\n[6] https://github.com/git/git/blob/75ae10bc75336db031ee58d13c5037b929235912/builtin/submodule--helper.c#L258-L260\n[7] https://github.com/tfidfwastaken/git/commits/submodule-helper-update-1a\n\n> I have not been able to get a complete picture of this myself. I'll try to take better\n> look later and see if I could get anything.\n> \n> Note that this could also be me just not being able to get a proper picture of it.\n> Just wanted to share it in case others are able to get any ideas or able to think of a\n> possible cause.\n> \n> [4]: https://github.com/git/git/blob/abb21c7263616f01c5e950861a29279ab21cb02f/git-submodule.sh#L654-L658\n> -- >8 --\n> \n> I hope that gives a better idea about what kind of information would be helpful.\n> Kindly let me know if it doesn't.\n> \n> Atharva,\n> \n> In the meanwhile, I think you could continue polishing your attempted solution\n> and preparing to send it to the list. I'll try to dig more on my gut instinct\n> and let you know if I get anything. If you have some free time left after\n> polishing your series, you could try digging into it too :)\n\nSure. Thanks for the time and effort you are putting into this!\n\n> -- \n> Sivaraam\n\n"},{"id":"430479","messageId":"A644ECB8-E272-4EA9-9606-E13A36270C9D@gmail.com","threadId":"56123","inReplyTo":"CAP8UFD0NCQ5w_3GtT_xHr35i7h8BuLX4UcHNY6VHPGREmDVObA@mail.gmail.com","subject":"Re: My Git Dev Blog - Week 9","fromName":"Atharva Raykar","fromEmail":"raykar.ath@gmail.com","sentAt":"2021-07-19T08:57:25Z","receivedAt":"2021-07-19T08:58:29Z","isPatch":false,"sender":{"key":"raykar.ath@gmail.com","avatar":"https://avatars.githubusercontent.com/u/24277692?v=4"},"body":"On 18-Jul-2021, at 18:45, Christian Couder <christian.couder@gmail.com> wrote:\n> \n> On Sun, Jul 18, 2021 at 1:59 PM Atharva Raykar <raykar.ath@gmail.com> wrote:\n>> \n>> Here's my latest blog post:\n>> https://atharvaraykar.me/gitnotes/week9\n> \n> Great!\n> \n>> A part that may be interesting to list readers:\n>> \n>> - In one section of the blog, I describe the problem of the git\n>>  submodule configuration not updating properly, when I launch\n>>  a subprocess that first initialises the submodule. I will\n>>  appreciate it if someone has a possible explanation for the\n>>  issue I faced at:\n>>  https://atharvaraykar.me/gitnotes/week9#launching-the-init-part-as-a-subprocess\n> \n> My wild guess about why is_submodule_active() might not be working as\n> expected is that submodule_from_path() uses the submodule cache which\n> might not be properly updated when a submodule is initialized by a\n> subprocess.\n\nRight, I have made a note of this. It does feel like the most plausible\nexplanation, which I might look into after my update series is done.\n\n>> The rest of the post talks about my project progress so far, and how I\n>> avoided the above problem entirely for now by taking a different approach.\n> \n> Nice that you found a possible better way!\n\n"},{"id":"430482","messageId":"E8CA36A6-2FC0-4A76-9461-D5F4CA205AB8@gmail.com","threadId":"56123","inReplyTo":"fcb14e9b-c76d-9a54-fccb-d66e7de04f7a@gmail.com","subject":"Re: My Git Dev Blog - Week 9","fromName":"Atharva Raykar","fromEmail":"raykar.ath@gmail.com","sentAt":"2021-07-19T08:53:29Z","receivedAt":"2021-07-19T09:01:15Z","isPatch":false,"sender":{"key":"raykar.ath@gmail.com","avatar":"https://avatars.githubusercontent.com/u/24277692?v=4"},"body":"On 19-Jul-2021, at 06:21, Bagas Sanjaya <bagasdotme@gmail.com> wrote:\n> \n> On 18/07/21 18.59, Atharva Raykar wrote:\n>> Here's my latest blog post:\n>> https://atharvaraykar.me/gitnotes/week9\n> \n> You wrote:\n>> Interact more with the community by asking questions in your patch cover letters and replies to reviews.\n> \n> Did you mean something like [RFC PATCH]?\n\nThat would be one part of it, but I meant it in a more general sense, ie,\nit is better to be detailed and specific about design decisions in a patch\nthat one may not be sure of, and mention it up front.\n\nThat, and asking questions to reviewers to clarify what they mean, and their\nmotivations behind it, if one is not sure of those.\n\n> -- \n> An old man doll... just what I always wanted! - Clara\n\n"}]}