Skip to content

Commit c684b58

Browse files
committed
Merge branch 'ps/reftable-backend' into kn/for-all-refs
* ps/reftable-backend: refs/reftable: fix leak when copying reflog fails ci: add jobs to test with the reftable backend refs: introduce reftable backend
2 parents c875e0b + 8a0bebd commit c684b58

17 files changed

+3248
-7
lines changed

.github/workflows/main.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,9 @@ jobs:
266266
- jobname: linux-sha256
267267
cc: clang
268268
pool: ubuntu-latest
269+
- jobname: linux-reftable
270+
cc: clang
271+
pool: ubuntu-latest
269272
- jobname: linux-gcc
270273
cc: gcc
271274
cc_package: gcc-8
@@ -277,6 +280,9 @@ jobs:
277280
- jobname: osx-clang
278281
cc: clang
279282
pool: macos-13
283+
- jobname: osx-reftable
284+
cc: clang
285+
pool: macos-13
280286
- jobname: osx-gcc
281287
cc: gcc
282288
cc_package: gcc-13
@@ -287,6 +293,9 @@ jobs:
287293
- jobname: linux-leaks
288294
cc: gcc
289295
pool: ubuntu-latest
296+
- jobname: linux-reftable-leaks
297+
cc: gcc
298+
pool: ubuntu-latest
290299
- jobname: linux-asan-ubsan
291300
cc: clang
292301
pool: ubuntu-latest

.gitlab-ci.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ test:linux:
2626
- jobname: linux-sha256
2727
image: ubuntu:latest
2828
CC: clang
29+
- jobname: linux-reftable
30+
image: ubuntu:latest
31+
CC: clang
2932
- jobname: linux-gcc
3033
image: ubuntu:20.04
3134
CC: gcc
@@ -40,6 +43,9 @@ test:linux:
4043
- jobname: linux-leaks
4144
image: ubuntu:latest
4245
CC: gcc
46+
- jobname: linux-reftable-leaks
47+
image: ubuntu:latest
48+
CC: gcc
4349
- jobname: linux-asan-ubsan
4450
image: ubuntu:latest
4551
CC: clang
@@ -79,6 +85,9 @@ test:osx:
7985
- jobname: osx-clang
8086
image: macos-13-xcode-14
8187
CC: clang
88+
- jobname: osx-reftable
89+
image: macos-13-xcode-14
90+
CC: clang
8291
artifacts:
8392
paths:
8493
- t/failed-test-artifacts

Documentation/ref-storage-format.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
* `files` for loose files with packed-refs. This is the default.
2+
* `reftable` for the reftable format. This format is experimental and its
3+
internals are subject to change.

Documentation/technical/repository-version.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,5 +103,6 @@ GIT_COMMON_DIR/worktrees/<id>/config.worktree)
103103

104104
==== `refStorage`
105105

106-
Specifies the file format for the ref database. The only valid value
107-
is `files` (loose references with a packed-refs file).
106+
Specifies the file format for the ref database. The valid values are
107+
`files` (loose references with a packed-refs file) and `reftable` (see
108+
Documentation/technical/reftable.txt).

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1126,6 +1126,7 @@ LIB_OBJS += reflog.o
11261126
LIB_OBJS += refs.o
11271127
LIB_OBJS += refs/debug.o
11281128
LIB_OBJS += refs/files-backend.o
1129+
LIB_OBJS += refs/reftable-backend.o
11291130
LIB_OBJS += refs/iterator.o
11301131
LIB_OBJS += refs/packed-backend.o
11311132
LIB_OBJS += refs/ref-cache.o

ci/lib.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ linux-musl)
367367
MAKEFLAGS="$MAKEFLAGS NO_REGEX=Yes ICONV_OMITS_BOM=Yes"
368368
MAKEFLAGS="$MAKEFLAGS GIT_TEST_UTF8_LOCALE=C.UTF-8"
369369
;;
370-
linux-leaks)
370+
linux-leaks|linux-reftable-leaks)
371371
export SANITIZE=leak
372372
export GIT_TEST_PASSING_SANITIZE_LEAK=true
373373
export GIT_TEST_SANITIZE_LEAK_LOG=true

ci/run-build-and-tests.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ linux-clang)
3737
linux-sha256)
3838
export GIT_TEST_DEFAULT_HASH=sha256
3939
;;
40+
linux-reftable|linux-reftable-leaks|osx-reftable)
41+
export GIT_TEST_DEFAULT_REF_FORMAT=reftable
42+
;;
4043
pedantic)
4144
# Don't run the tests; we only care about whether Git can be
4245
# built.

contrib/workdir/git-new-workdir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ trap cleanup $siglist
7979
# create the links to the original repo. explicitly exclude index, HEAD and
8080
# logs/HEAD from the list since they are purely related to the current working
8181
# directory, and should not be shared.
82-
for x in config refs logs/refs objects info hooks packed-refs remotes rr-cache svn
82+
for x in config refs logs/refs objects info hooks packed-refs remotes rr-cache svn reftable
8383
do
8484
# create a containing directory if needed
8585
case $x in

path.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -871,7 +871,7 @@ const char *enter_repo(const char *path, int strict)
871871
return NULL;
872872
}
873873

874-
static int calc_shared_perm(int mode)
874+
int calc_shared_perm(int mode)
875875
{
876876
int tweak;
877877

path.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ const char *git_path_shallow(struct repository *r);
181181
int ends_with_path_components(const char *path, const char *components);
182182
int validate_headref(const char *ref);
183183

184+
int calc_shared_perm(int mode);
184185
int adjust_shared_perm(const char *path);
185186

186187
char *interpolate_path(const char *path, int real_home);

0 commit comments

Comments
 (0)