GSoC Week 7
What I Have Done
In this week, I still put my effort on handling reviews.
- Patch v9: In version 8, Karthik thinks that instead of renaming
skiplist
tooid_skiplist
, we’d better renameskiptlist
toskip_oids
. So, I simply apply this idea. And I have made a mistake in version 8, I use thestatic
for a string buf, but I forget to usestrbuf_reset
for each function call. So I add this statement here. However, Eric thinks that usingstatic
variable is a very bad idea, becausefsck_refs_error_function
should not be called frequently. The design will make the code harder to “libify”. This is one thing I have learned. And Justin has provided some reviews about the commit sequence and commit messages, need to make it clearer. - Patch v10: This patch solves the problem of version 9. But there are some new reviews coming from Junio. The first problem is that we should not name the report interface
vfsck_report
but “fsck_vreport”, and Junio feels that the current commit sequence is not so clear, need to adjust.
However, In patch v10, the most important question Junio asks is about the functionality fsck_refs_error_function
. The declaration of this function in patch v10 is shown below:
1 | int fsck_refs_error_function(struct fsck_options *options UNUSED, |
Junio thinks above declaration only handles the problem of the single ref such as refs/heads/main
. What about the packed-refs?
The error reporting function for refs consistency check was still about reporting a problem for a single ref. I am wondering how consistency violations that are not about a single ref should be handled. For example, if
refs/packed-backend.c:packed_fsck()
finds that the file is not sorted properly or has some unparsable garbage in it, it is not something you can report as “refs/heads/main is broken”, but those who are interested in seeing the “reference database consistency” verified, it is very much what they want the tool to notice.
So I need to find a way to handle this. So I decide to look at the spec of the packed-refs and reftable refs. And I finally find a way to do this.
After some investigations, there are the following situations where we should handle when checking ref consistency.
- When checking loose refs and reflofs, we only need the
checkee
information, because they are standalone files. - When checking packed-refs, we should check the packed-refs itself, for example whether it is sorted or there are some garbage trailing contents. However, we should also check each ref (
sub_checkee
) in the file. - When checking reftable refs, we need to check the binary file, we could still use the idea like 2 case.
By the above statements, I change the fsck_refs_error_function
shown as below:
1 | int fsck_refs_error_function(struct fsck_options *options UNUSED, |
It could provide the following report messages:
- “ref_checkee”: “fsck error name”: “user message”.
- “ref_checkee.sub_ref_checkee”: “fsck error name”: “user message”.
- “ref_checkee -> (oid hex)”: “fsck error name”: “user message”.
- “ref_checkee.sub_ref_checkee -> (oid hex)”: “fsck error name”: “user message”.
This is what I done in patch v11.
Next Plan
It’s important for me to set up the infra of consistency check for refs. Because everything will be built upon that. I think I will continue to handle the reviews.
Challenges
The recent challenges I’ve encountered mainly stem from two aspects. Over the past two weeks, I’ve felt mentally exhausted because I haven’t received much positive feedback. Since May 30th, my first patch is still under review. Sometimes, I can’t help but feel the pressure from my peers. Seeing other GSoC participants successfully merge several patches does indeed make me feel pressured. Therefore, I realize that I must learn how to adjust my mindset during prolonged review periods.
Secondly, there’s the issue raised by Junio regarding how to improve the “fsck_refs_error_function.” Junio actually brought this up in the initial version, but I subconsciously ignored it. Although I am responsible for building the infrastructure, I have limited knowledge about packed-refs and reftable refs. I thought it would be very difficult for me to design a perfect function. However, in the end, I had to face this problem head-on. Sometimes, when I encounter difficult issues, I tend to avoid them subconsciously. Despite this, I eventually found a solution.