{"thread":{"id":"61080","subject":"Re: Discuss GSoC: Implement consistency checks for refs","startedAt":"2024-03-10T10:01:38Z","lastAt":"2024-03-14T03:38:34Z","messageCount":2,"participants":["shejialuo","Kaartic Sivaraam"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"490316","messageId":"Ze2E_xgfwTUzsQ92@ArchLinux","threadId":"61080","inReplyTo":null,"subject":"Re: Discuss GSoC: Implement consistency checks for refs","fromName":"shejialuo","fromEmail":"shejialuo@gmail.com","sentAt":"2024-03-10T10:01:35Z","receivedAt":"2024-03-10T10:01:38Z","isPatch":false,"sender":{"key":"shejialuo@gmail.com","avatar":"https://avatars.githubusercontent.com/u/56911263?v=4"},"body":"Thanks for you help. I'm sorry for the delay in resonding to your email\ndue to my internship.\n\n> I know this is splitting hairs, but git-fsck(1) doesn't give us the\n> tools to avoid corruption. It only gives us the tools to detect it after\n> the fact.\n\nI DO misundestood the `git-fsck(1)`.\n\nThis time, I have read more source codes about `git-fsck` and refs\ninternal. So I wanna discuss some implementation of the infrastructure\nthis time.\n\nI am inspired by `refs-internal.h`, this file declares `ref_storage_be`,\nand for every backend, it should implement the interfaces like\n`ref_store_init_fn`, `ref_init_db_fn` and etc. And in `refs.h`, it\nprovides the interfaces to other modules.\n\nBased above idea, I think we could just create files in `refs` directory\nand we could implement a file called `ref-check.h`, we design the\ninterfaces for different backends.\n\nAfter that, we could compose this structure into `ref_storage_be` and we\ncould call these interfaces in `fsck.c`. If there are some different\ninterfaces, we could downcast to a specified type to call the specified\nfunctions. (Actually, I have learned a lot how OOP is implemented in C).\n\n> For what it's worth, not all of the checks need to be implemented as\n> part of GSoC. At a minimum, it should result in the infra to allow for\n> backend-specific checks and a couple of checks for at least one of the\n> backends.\n\nI think using the above idea, we could provide an infrastructure to allow\nmore checks later.\n\n> You will certainly need to learn about ref internals a bit. There are\n> some common rules and restrictions that are important in order to figure\n> out what we want to check in the first place. Understanding the\n> \"reftable\" format would be great, but you may also get away with only\n> implementing generic or \"files\"-backend specific consistency checks.\n> This depends on the scope you are aiming for.\n\nI think I will at least implement the generic part and files-backend\nconsistency check. I will then read some specs about the reftable and the\nsource code of it. If there is sufficient time available, I think I\ncould implement all of them. However, I am currently interning remotely,\nthe response may slow.\n"},{"id":"490603","messageId":"04793E15-8C44-45BE-8B17-744EB94B245C@gmail.com","threadId":"61080","inReplyTo":"Ze2E_xgfwTUzsQ92@ArchLinux","subject":"Re: Discuss GSoC: Implement consistency checks for refs","fromName":"Kaartic Sivaraam","fromEmail":"kaartic.sivaraam@gmail.com","sentAt":"2024-03-14T03:38:28Z","receivedAt":"2024-03-14T03:38:34Z","isPatch":false,"sender":{"key":"kaartic.sivaraam@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12448084?v=4"},"body":"Hi Jialuo,\n\nJust wanted to chime in to mention one thing.\n\nOn 10 March 2024 3:31:35 pm IST, shejialuo <shejialuo@gmail.com> wrote:\n>\n>I think I will at least implement the generic part and files-backend\n>consistency check. I will then read some specs about the reftable and the\n>source code of it. If there is sufficient time available, I think I\n>could implement all of them. However, I am currently interning remotely,\n>the response may slow.\n>\n\nThanks for mentioning this. If your current internship would overlap\nwith the GSoC period, kindly clarify the same in your proposal. Also,\nif it does overlap kindly clarify the amount of time you'll be able to\nallocate for the GSoC project in the proposal.\n\nThis would be helpful to set the expectations right.\n\n-- \nSivaraam\n\nSent from my Android device with K-9 Mail. Please excuse my brevity.\n"}]}