Skip to content

reftable: drop generic `reftable_table` interface

Patrick Steinhardt git 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest15 patches 2 repliesIn review
  2. v215 patches 6 repliesSuperseded
  3. v110 patches 14 repliesSuperseded

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/15reftable/merged: expose functions to initialize iteratorsreftable/merged.c reftable/reftable-merged.h+20 -00 replies
2/15reftable/merged: rename `reftable_new_merged_table()`reftable/merged.c reftable/reftable-merged.h reftable/stack.c +1 more+12 -110 replies
3/15reftable/merged: stop using generic tables in the merged tablereftable/merged.c reftable/merged.h reftable/reader.c +5 more+60 -750 replies
4/15reftable/stack: open-code reading refsreftable/stack.c+22 -30 replies
5/15reftable/iter: drop double-checking logicreftable/iter.c reftable/iter.h reftable/reader.c+0 -240 replies
6/15reftable/generic: move generic iterator code into iterator interfacereftable/generic.c reftable/generic.h reftable/iter.c +1 more+133 -1160 replies
7/15reftable/dump: drop unused `compact_stack()`reftable/dump.c+1 -260 replies
8/15t/helper: inline `reftable_dump_main()`Makefile reftable/dump.c reftable/reftable-tests.h +1 more+60 -890 replies
9/15t/helper: inline `reftable_reader_print_file()`reftable/reader.c reftable/reftable-reader.h t/helper/test-reftable.c+22 -240 replies
10/15t/helper: inline `reftable_stack_print_directory()`reftable/reftable-stack.h reftable/stack.c reftable/stack_test.c +1 more+22 -310 replies
11/15t/helper: inline `reftable_table_print()`reftable/generic.c reftable/reftable-generic.h t/helper/test-reftable.c+50 -520 replies
12/15t/helper: inline printing of reftable recordsreftable/record.c reftable/record.h reftable/reftable-record.h +1 more+69 -1440 replies
13/15t/helper: use `hash_to_hex_algop()` to print hashest/helper/test-reftable.c+11 -370 replies
14/15t/helper: refactor to not use `struct reftable_table`t/helper/test-reftable.c+18 -150 replies
15/15reftable/generic: drop interfaceMakefile reftable/generic.c reftable/generic.h +9 more+0 -2450 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCH v3 00/15] reftable: drop generic `reftable_table` interface

Hi,

this is the third version of my patch series that gets rid of the generic reftable_table interface. It made it way harder to understand the reftable code base and is not really required nowadays anymore where we have generic re-seekable reftable iterators.

There is only a single change compared to v2, which updates one of the commit messages to explain why it is fine to drop tests for the printing functionality.

This patch series continues to build on top of 25673b1c47 (The third batch, 2024-08-07) with Junio's ps/reftable-stack-compaction at f234df07f6 (reftable/stack: handle locked tables during auto-compaction, 2024-08-08) merged into it.

Thanks!

Patrick

Patrick Steinhardt (15):
reftable/merged: expose functions to initialize iterators reftable/merged: rename reftable_new_merged_table() reftable/merged: stop using generic tables in the merged table reftable/stack: open-code reading refs
reftable/iter: drop double-checking logic reftable/generic: move generic iterator code into iterator interface reftable/dump: drop unused compact_stack()
t/helper: inline reftable_dump_main()
t/helper: inline reftable_reader_print_file()
t/helper: inline reftable_stack_print_directory() t/helper: inline reftable_table_print()
t/helper: inline printing of reftable records
t/helper: use hash_to_hex_algop() to print hashes t/helper: refactor to not use struct reftable_table reftable/generic: drop interface

 Makefile                         |   2 -
 reftable/dump.c                  | 111 ---------------
 reftable/generic.c               | 229 -------------------------------
 reftable/generic.h               |  37 -----
 reftable/iter.c                  | 126 ++++++++++++++---
 reftable/iter.h                  |  30 +++-
 reftable/merged.c                |  72 ++++------
 reftable/merged.h                |   4 +-
 reftable/reader.c                |  70 +---------
 reftable/reader.h                |   4 +
 reftable/record.c                | 127 -----------------
 reftable/record.h                |   1 -
 reftable/reftable-generic.h      |  47 -------
 reftable/reftable-merged.h       |  26 ++--
 reftable/reftable-reader.h       |   9 --
 reftable/reftable-record.h       |   8 --
 reftable/reftable-stack.h        |   3 -
 reftable/reftable-tests.h        |   1 -
 reftable/stack.c                 |  94 ++++++-------
 reftable/stack_test.c            |  29 ++--
 t/helper/test-reftable.c         | 189 ++++++++++++++++++++++++-
 t/unit-tests/t-reftable-merged.c |  17 +--
 22 files changed, 422 insertions(+), 814 deletions(-)
 delete mode 100644 reftable/dump.c
 delete mode 100644 reftable/generic.c
 delete mode 100644 reftable/generic.h
 delete mode 100644 reftable/reftable-generic.h

Range-diff against v2:

 1:  472c169b501 =  1:  472c169b501 reftable/merged: expose functions to initialize iterators
 2:  bc6f1cd8c1b =  2:  bc6f1cd8c1b reftable/merged: rename `reftable_new_merged_table()`
 3:  58e91ab4b34 =  3:  58e91ab4b34 reftable/merged: stop using generic tables in the merged table
 4:  6ba3fcee411 =  4:  6ba3fcee411 reftable/stack: open-code reading refs
 5:  cac08a934c5 =  5:  cac08a934c5 reftable/iter: drop double-checking logic
 6:  103262dc79c =  6:  103262dc79c reftable/generic: move generic iterator code into iterator interface
 7:  4011fa65d81 =  7:  4011fa65d81 reftable/dump: drop unused `compact_stack()`
 8:  ceaa296bfd4 =  8:  ceaa296bfd4 t/helper: inline `reftable_dump_main()`
 9:  a62e4612e97 =  9:  a62e4612e97 t/helper: inline `reftable_reader_print_file()`
10:  7acfe4fecc5 ! 10:  242c179df5f t/helper: inline `reftable_stack_print_directory()`

@@ Commit message
Move reftable_stack_print_directory() into the "dump-reftable" helper. This follows the same reasoning as the preceding commit.

+ Note that this requires us to remove the tests for this functionality in
+ reftable/stack_test.c. The test does not really add much anyway,
+ because all it verifies is that we do not crash or run into an error,
+ and it specifically doesn't check the outputted data. Also, as the code
+ is now part of the test helper, it doesn't make much sense to have a
+ unit test for it in the first place.
+

## reftable/reftable-stack.h ##

11:  8bd53a1a656 = 11:  a05e2060996 t/helper: inline `reftable_table_print()`
12:  c50aabbb804 = 12:  ee22a08e11e t/helper: inline printing of reftable records
13:  5498395872c = 13:  0a3c619e842 t/helper: use `hash_to_hex_algop()` to print hashes
14:  5390be75c37 = 14:  8eab399dfc6 t/helper: refactor to not use `struct reftable_table`
15:  5aeab8ee077 = 15:  b5d7b5679b5 reftable/generic: drop interface
Signature · 1 line
2.46.0.164.g477ce5ccd6.dirty