From: Karthik Nayak Date: Tue, 07 Oct 2025 08:47:14 GMT Subject: Re: [PATCH v5 0/7] refs/reftable: add consistency checks Message-ID: In-Reply-To: Junio C Hamano writes: > Karthik Nayak writes: > >> The reference subsystems allows for adding backend specific consistency >> checks. These checks are run as part of 'git refs verify'. >> >> While the files backend has some consistency checks added, the reftable >> backend currently has none. This series first tightens the reftable >> backend to make it a little more strict and then also adds the required >> infrastructure and some simple consistency checks. >> >> Since the reftable backend is treated as a library within the Git >> codebase, we don't want to spillover our internal fsck implementation >> into the library. At the same time, the fsck checks need to access >> internal structures of the reftable library which aren't exposed outside >> the library. >> >> So we solve this by adding a 'reftable/fsck.[ch]' which implements and >> exposes a checker for the reftable library and returns specific errors >> as defined by the library. We then add glue code within >> 'refs/reftable-backend.c' to map these errors to errors which Git's fsck >> implementation would understand. This allows us to separate concerns. >> >> We add the following consistency checks: >> >> 1. Check for validating the reftable table name. This is treated as a >> warning since the reftable specification only suggests a table name >> but doesn't enforce it. Also there is a difference in the table name >> used in Git vs that in jGit. >> >> We tighten the reftable backend by raising a REFTABLE_FORMAT_ERROR error >> when: >> >> 1. The 'tables.list' file doesn't have a trailing newline. >> >> --- >> Changes in v5: >> - Added documentation around the return value of 'parse_names()'. >> - Added a test to validate that 'git refs verify' doesn't barf against >> a clean working repository with multiple reftable tables. >> - Link to v4: https://lore.kernel.org/all/20250926-228-reftable-introduce-consistency-checks-v4-0-c96fd8551c0d@gmail.com > > Looking good. Shall we declare victory and mark the topic for > 'next' now? > > Thanks. Peff pointed out a mistake in my test, where I create root refs instead of branches. This works without issues as we don't yet have reference level checks on reftables. While it is good as is, I do think it is confusing, so will send in a new version with a fix. Let's hold out for that and we can merge that to 'next'. Thanks, Karthik