diff mbox series

[v6,17/18] reftable: decouple from Git codebase by pulling in "compat/posix.h"

Message ID 20250218-pks-reftable-drop-git-compat-util-v6-17-8c1f39fb4c02@pks.im (mailing list archive)
State New
Headers show
Series reftable: stop using "git-compat-util.h" | expand

Commit Message

Patrick Steinhardt Feb. 18, 2025, 9:20 a.m. UTC
The reftable library includes "git-compat-util.h" in order to get a
POSIX-like programming environment that papers over various differences
between platforms. The header also brings with it a couple of helpers
specific to the Git codebase though, and over time we have started to
use these helpers in the reftable library, as well.

This makes it very hard to use the reftable library as a standalone
library without the rest of the Git codebase, so other libraries like
e.g. libgit2 cannot easily use it. But now that we have removed all
calls to Git-specific functionality and have split out "compat/posix.h"
as a separate header we can address this.

Stop including "git-compat-util.h" and instead include "compat/posix.h"
to finalize the decoupling of the reftable library from the rest of the
Git codebase. The only bits which remain specific to Git are "system.h"
and "system.c", which projects will have to provide.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
---
 reftable/system.c | 2 ++
 reftable/system.h | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/reftable/system.c b/reftable/system.c
index e25ccc0da3c..1ee268b125d 100644
--- a/reftable/system.c
+++ b/reftable/system.c
@@ -1,3 +1,5 @@ 
+#include "../git-compat-util.h"
+
 #include "system.h"
 #include "basics.h"
 #include "reftable-error.h"
diff --git a/reftable/system.h b/reftable/system.h
index bb6a7e6285b..10055fbff2d 100644
--- a/reftable/system.h
+++ b/reftable/system.h
@@ -11,7 +11,7 @@  license that can be found in the LICENSE file or at
 
 /* This header glues the reftable library to the rest of Git */
 
-#include "git-compat-util.h"
+#include "compat/posix.h"
 #include "compat/zlib-compat.h"
 
 /*