Subject: [PATCH 0/7] reftable: stop using Git subsystems

From: Patrick Steinhardt <[email-masked]>
Date: Wed, 23 Oct 2024 11:55:52 +0200

Hi,

this patch series is another step towards detangling the reftable
library from libgit.a. This step removes all uses of Git subsystems like
"hash.h", "tempfile.h" and "lockfile.h" in favor of either providing our
own infra for this ("hash.h") or by implementing compatibility shims
that bridge between Git and the reftable library ("tempfile.h",
"lockfile.h").

This is the second-last step in the overall effort to detangle those two
codebases from each other. The last step will be to split out POSIX bits
from "git-compat-util.h" into a separate "compat/posix.h" header that we
then use from the reftable library such that we don't pull in any of the
Git-specific parts into it.

This series is built on top of fd3785337b (The third batch, 2024-10-22)
with ps/reftable-strbuf at 20590cd287 (reftable: handle trivial
`reftable_buf` errors, 2024-10-17) merged into it.

Thanks!

Patrick

Patrick Steinhardt (7):
  reftable/system: move "dir.h" to its only user
  reftable: explicitly handle hash format IDs
  reftable/system: stop depending on "hash.h"
  reftable/stack: stop using `fsync_component()` directly
  reftable/system: provide thin wrapper for tempfile subsystem
  reftable/stack: drop only use of `get_locked_file_path()`
  reftable/system: provide thin wrapper for lockfile subsystem

 Makefile                            |   1 +
 refs/reftable-backend.c             |  19 +++-
 reftable/basics.c                   |  13 ++-
 reftable/basics.h                   |   9 +-
 reftable/merged.c                   |   4 +-
 reftable/merged.h                   |   3 +-
 reftable/reader.c                   |  14 ++-
 reftable/reader.h                   |   4 +-
 reftable/reftable-basics.h          |  13 +++
 reftable/reftable-merged.h          |   4 +-
 reftable/reftable-reader.h          |   2 +-
 reftable/reftable-record.h          |  12 +-
 reftable/reftable-writer.h          |   8 +-
 reftable/stack.c                    | 171 ++++++++++++++--------------
 reftable/system.c                   | 126 ++++++++++++++++++++
 reftable/system.h                   |  88 +++++++++++++-
 reftable/writer.c                   |  20 +++-
 t/helper/test-reftable.c            |   4 +-
 t/unit-tests/lib-reftable.c         |   5 +-
 t/unit-tests/lib-reftable.h         |   2 +-
 t/unit-tests/t-reftable-block.c     |  41 +++----
 t/unit-tests/t-reftable-merged.c    |  26 ++---
 t/unit-tests/t-reftable-pq.c        |   3 +-
 t/unit-tests/t-reftable-reader.c    |   4 +-
 t/unit-tests/t-reftable-readwrite.c |  41 +++----
 t/unit-tests/t-reftable-record.c    |  59 +++++-----
 t/unit-tests/t-reftable-stack.c     |  37 +++---
 27 files changed, 504 insertions(+), 229 deletions(-)
 create mode 100644 reftable/system.c

-- 
2.47.0.118.gfd3785337b.dirty