Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHan-Wen Nienhuys <hanwen@google.com>2021-10-07 23:25:11 +0300
committerJunio C Hamano <gitster@pobox.com>2021-10-08 20:45:48 +0300
commit1ae2b8cda84c4c662d8f60898e034d9643f097b6 (patch)
tree6102a9b4b4747e2b653a5cd5486dd1adac5bf59c /reftable/merged.h
parent3b34f636df9e6c32c2e9b819cd5ad907497c62b7 (diff)
reftable: add merged table view
This adds an abstract, read-only interface to the ref database. This primitive is used to construct the read view of the ref database (the read view is constructed by merging several *.ref files). It also provides the mechanism to provide a unified view of the refs in the main repository and the per-worktree refs. Signed-off-by: Han-Wen Nienhuys <hanwen@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'reftable/merged.h')
-rw-r--r--reftable/merged.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/reftable/merged.h b/reftable/merged.h
new file mode 100644
index 0000000000..7d9f95d27e
--- /dev/null
+++ b/reftable/merged.h
@@ -0,0 +1,38 @@
+/*
+Copyright 2020 Google LLC
+
+Use of this source code is governed by a BSD-style
+license that can be found in the LICENSE file or at
+https://developers.google.com/open-source/licenses/bsd
+*/
+
+#ifndef MERGED_H
+#define MERGED_H
+
+#include "pq.h"
+
+struct reftable_merged_table {
+ struct reftable_table *stack;
+ size_t stack_len;
+ uint32_t hash_id;
+
+ /* If unset, produce deletions. This is useful for compaction. For the
+ * full stack, deletions should be produced. */
+ int suppress_deletions;
+
+ uint64_t min;
+ uint64_t max;
+};
+
+struct merged_iter {
+ struct reftable_iterator *stack;
+ uint32_t hash_id;
+ size_t stack_len;
+ uint8_t typ;
+ int suppress_deletions;
+ struct merged_iter_pqueue pq;
+};
+
+void merged_table_release(struct reftable_merged_table *mt);
+
+#endif