Skip to content

Commit 2beccb7

Browse files
committed
Merge branch 'ps/reftable-sans-compat-util' into jch
Make the code in reftable library less reliant on the service routines it used to borrow from Git proper, to make it easier to use by external users of the library. * ps/reftable-sans-compat-util: Makefile: skip reftable library for Coccinelle reftable: decouple from Git codebase by pulling in "compat/posix.h" git-compat-util.h: split out POSIX-emulating bits compat/msvc: split out POSIX-related bits compat/mingw: split out POSIX-related bits compat: consistently resolve headers via project root reftable/basics: stop using `UNUSED` annotation reftable/basics: stop using `SWAP()` macro reftable/stack: stop using `sleep_millisec()` reftable/system: introduce `reftable_rand()` reftable/reader: stop using `ARRAY_SIZE()` macro reftable/basics: provide wrappers for big endian conversion reftable/basics: stop using `st_mult()` in array allocators reftable: stop using `BUG()` in trivial cases reftable/record: don't `BUG()` in `reftable_record_cmp()` reftable/record: stop using `BUG()` in `reftable_record_init()` reftable/record: stop using `COPY_ARRAY()` reftable/blocksource: stop using `xmmap()` reftable/stack: stop using `write_in_full()` reftable/stack: stop using `read_in_full()`
2 parents e7b0ba7 + b4829bc commit 2beccb7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+1281
-992
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -955,7 +955,7 @@ FOUND_SOURCE_FILES := $(filter-out $(GENERATED_H),$(shell $(SOURCES_CMD)))
955955
FOUND_C_SOURCES = $(filter %.c,$(FOUND_SOURCE_FILES))
956956
FOUND_H_SOURCES = $(filter %.h,$(FOUND_SOURCE_FILES))
957957

958-
COCCI_SOURCES = $(filter-out $(THIRD_PARTY_SOURCES),$(FOUND_C_SOURCES))
958+
COCCI_SOURCES = $(filter-out $(THIRD_PARTY_SOURCES) reftable/%,$(FOUND_C_SOURCES))
959959

960960
LIB_H = $(FOUND_H_SOURCES)
961961

compat/access.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#define COMPAT_CODE_ACCESS
2-
#include "../git-compat-util.h"
2+
3+
#include "git-compat-util.h"
34

45
/* Do the same thing access(2) does, but use the effective uid,
56
* and don't make the mistake of telling root that any file is

compat/basename.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#include "../git-compat-util.h"
2-
#include "../strbuf.h"
1+
#include "git-compat-util.h"
2+
#include "strbuf.h"
33

44
/* Adapted from libiberty's basename.c. */
55
char *gitbasename (char *path)

compat/fileno.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#define COMPAT_CODE_FILENO
2-
#include "../git-compat-util.h"
2+
#include "git-compat-util.h"
33

44
int git_fileno(FILE *stream)
55
{

compat/fopen.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* fopen after including git-compat-util.h is inadequate in this case.
1010
*/
1111
#define SUPPRESS_FOPEN_REDEFINITION
12-
#include "../git-compat-util.h"
12+
#include "git-compat-util.h"
1313

1414
FILE *git_fopen(const char *path, const char *mode)
1515
{

compat/fsmonitor/fsm-health-darwin.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#include "git-compat-util.h"
2+
#include "compat/fsmonitor/fsm-health.h"
23
#include "config.h"
34
#include "fsmonitor-ll.h"
4-
#include "fsm-health.h"
55
#include "fsmonitor--daemon.h"
66

77
int fsm_health__ctor(struct fsmonitor_daemon_state *state UNUSED)

compat/fsmonitor/fsm-health-win32.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#include "git-compat-util.h"
2+
#include "compat/fsmonitor/fsm-health.h"
23
#include "config.h"
34
#include "fsmonitor-ll.h"
4-
#include "fsm-health.h"
55
#include "fsmonitor--daemon.h"
66
#include "gettext.h"
77
#include "simple-ipc.h"

compat/fsmonitor/fsm-listen-darwin.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#ifndef __clang__
22
#include <dispatch/dispatch.h>
3-
#include "fsm-darwin-gcc.h"
3+
#include "compat/fsmonitor/fsm-darwin-gcc.h"
44
#else
55
#include <CoreFoundation/CoreFoundation.h>
66
#include <CoreServices/CoreServices.h>
@@ -24,8 +24,8 @@
2424
#endif
2525

2626
#include "git-compat-util.h"
27+
#include "compat/fsmonitor/fsm-listen.h"
2728
#include "fsmonitor-ll.h"
28-
#include "fsm-listen.h"
2929
#include "fsmonitor--daemon.h"
3030
#include "fsmonitor-path-utils.h"
3131
#include "gettext.h"

compat/fsmonitor/fsm-listen-win32.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#include "git-compat-util.h"
2+
#include "compat/fsmonitor/fsm-listen.h"
23
#include "config.h"
34
#include "fsmonitor-ll.h"
4-
#include "fsm-listen.h"
55
#include "fsmonitor--daemon.h"
66
#include "gettext.h"
77
#include "simple-ipc.h"

compat/inet_ntop.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* SOFTWARE.
1616
*/
1717

18-
#include "../git-compat-util.h"
18+
#include "git-compat-util.h"
1919

2020
#ifndef NS_INADDRSZ
2121
#define NS_INADDRSZ 4

0 commit comments

Comments
 (0)