git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v4 6/7] reftable: add code to facilitate consistency checks

From
Patrick Steinhardt <ps@pks.im>
Date
Oct 2, 2025, 11:44 UTC
Message-ID
<aN5lngvE39JGwGSx@pks.im>
In-Reply-To
<20250926-228-reftable-introduce-consistency-checks-v4-6-c96fd8551c0d@gmail.com>
On Fri, Sep 26, 2025 at 09:25:49AM +0200, Karthik Nayak wrote:
Show 6 quoted lines
> diff --git a/reftable/fsck.c b/reftable/fsck.c
> new file mode 100644
> index 0000000000..26b9115b14
> --- /dev/null
> +++ b/reftable/fsck.c
> @@ -0,0 +1,100 @@
[snip]
Show 16 quoted lines
> +static int table_checks(struct reftable_table *table,
> +			reftable_fsck_report_fn report_fn,
> +			reftable_fsck_verbose_fn verbose_fn UNUSED,
> +			void *cb_data)
> +{
> +	table_check_fn table_check_fns[] = {
> +		table_check_name,
> +		NULL,
> +	};
> +	int err = 0;
> +
> +	for (size_t i = 0; table_check_fns[i]; i++)
> +		err |= table_check_fns[i](table, report_fn, cb_data);
> +
> +	return err;
> +}

Okay, good. We now only verify individual table names part of the stack, and don't scan the directory anymore. Furthermore, it is easy to add more tests by adding to the function array.

Patrick
Previous: Karthik NayakNext: Karthik Nayak
Message 10 of 14 in “refs/reftable: add consistency checks”
  1. 0/7 refs/reftable: add consistency checksKarthik Nayak, Sep 26, 2025
  2. 1/7 refs: remove unused headersKarthik Nayak, Sep 26, 2025
  3. 2/7 refs: move consistency check msg to generic layerKarthik Nayak, Sep 26, 2025
  4. 3/7 reftable: check for trailing newline in 'tables.list'Karthik Nayak, Sep 26, 2025
  5. Patrick SteinhardtOct 2, 2025
  6. Karthik NayakOct 6, 2025
  7. 4/7 Documentation/fsck-msgids: remove duplicate msg idKarthik Nayak, Sep 26, 2025
  8. 5/7 fsck: order 'fsck_msg_type' alphabeticallyKarthik Nayak, Sep 26, 2025
  9. 6/7 reftable: add code to facilitate consistency checksKarthik Nayak, Sep 26, 2025
  10. Patrick SteinhardtOct 2, 2025
  11. 7/7 refs/reftable: add fsck check for checking the table nameKarthik Nayak, Sep 26, 2025
  12. Patrick SteinhardtOct 2, 2025
  13. Karthik NayakOct 6, 2025
  14. Junio C HamanoSep 26, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.