aboutsummaryrefslogtreecommitdiff
path: root/format
diff options
context:
space:
mode:
authorGravatar Runxi Yu2026-03-29 13:26:10 +0000
committerGravatar Runxi Yu2026-03-29 13:26:10 +0000
commit2006e2e07f073a79a84194a304e4958a8739d645 (patch)
treefc08391aa0d4693350ce19541ece804db33dc3fe /format
parentTODO: What does git.sr.ht and tangled need (diff)
signatureNo signature
format/commitgraph: Remove MT-ReadSafe; use MT-Safe/Unsafe
Diffstat (limited to 'format')
-rw-r--r--format/commitgraph/read/bloom.go6
-rw-r--r--format/commitgraph/read/commitat.go2
-rw-r--r--format/commitgraph/read/commits.go2
-rw-r--r--format/commitgraph/read/hash.go2
-rw-r--r--format/commitgraph/read/iterators.go4
-rw-r--r--format/commitgraph/read/layerinfo.go2
-rw-r--r--format/commitgraph/read/lookup.go2
-rw-r--r--format/commitgraph/read/oidat.go2
-rw-r--r--format/commitgraph/read/reader.go2
9 files changed, 17 insertions, 7 deletions
diff --git a/format/commitgraph/read/bloom.go b/format/commitgraph/read/bloom.go
index 53d724f9..bf9dcbc6 100644
--- a/format/commitgraph/read/bloom.go
+++ b/format/commitgraph/read/bloom.go
@@ -8,6 +8,8 @@ import (
)
// HasBloom reports whether any layer has changed-path Bloom data.
+//
+// Labels: MT-Safe.
func (reader *Reader) HasBloom() bool {
for i := range reader.layers {
layer := &reader.layers[i]
@@ -20,6 +22,8 @@ func (reader *Reader) HasBloom() bool {
}
// BloomVersion returns the changed-path Bloom hash version, or 0 if absent.
+//
+// Labels: MT-Safe.
func (reader *Reader) BloomVersion() uint8 {
for i := len(reader.layers) - 1; i >= 0; i-- {
layer := &reader.layers[i]
@@ -43,7 +47,7 @@ func (reader *Reader) BloomVersion() uint8 {
//
// Returns BloomUnavailableError when this commit graph has no Bloom data.
//
-// Labels: Life-Parent.
+// Labels: MT-Safe, Life-Parent.
func (reader *Reader) BloomFilterAt(pos Position) (bloom.Filter, error) {
layer, err := reader.layerByPosition(pos)
if err != nil {
diff --git a/format/commitgraph/read/commitat.go b/format/commitgraph/read/commitat.go
index 827c72ce..726a09bd 100644
--- a/format/commitgraph/read/commitat.go
+++ b/format/commitgraph/read/commitat.go
@@ -9,7 +9,7 @@ import (
// CommitAt returns decoded commit-graph metadata at one position.
//
-// Labels: Life-Independent.
+// Labels: MT-Safe, Life-Independent.
func (reader *Reader) CommitAt(pos Position) (Commit, error) {
layer, err := reader.layerByPosition(pos)
if err != nil {
diff --git a/format/commitgraph/read/commits.go b/format/commitgraph/read/commits.go
index 48984ecb..e0a299e7 100644
--- a/format/commitgraph/read/commits.go
+++ b/format/commitgraph/read/commits.go
@@ -15,6 +15,8 @@ type Commit struct {
}
// NumCommits returns total commits across loaded layers.
+//
+// Labels: MT-Safe.
func (reader *Reader) NumCommits() uint32 {
return reader.total
}
diff --git a/format/commitgraph/read/hash.go b/format/commitgraph/read/hash.go
index 3a525afe..4c0e3d2d 100644
--- a/format/commitgraph/read/hash.go
+++ b/format/commitgraph/read/hash.go
@@ -9,6 +9,8 @@ import (
)
// HashVersion returns the commit-graph hash version.
+//
+// Labels: MT-Safe.
func (reader *Reader) HashVersion() uint8 {
return reader.hashVersion
}
diff --git a/format/commitgraph/read/iterators.go b/format/commitgraph/read/iterators.go
index 0e31f7e5..f8731526 100644
--- a/format/commitgraph/read/iterators.go
+++ b/format/commitgraph/read/iterators.go
@@ -9,7 +9,7 @@ import (
// AllPositions iterates all commit positions in native layer order.
//
-// Labels: Life-Parent.
+// Labels: MT-Safe, Life-Parent.
func (reader *Reader) AllPositions() iter.Seq[Position] {
return func(yield func(Position) bool) {
for layerIdx := range reader.layers {
@@ -31,7 +31,7 @@ func (reader *Reader) AllPositions() iter.Seq[Position] {
// AllOIDs iterates all commit object IDs in native layer order.
//
-// Labels: Life-Parent.
+// Labels: MT-Safe, Life-Parent.
func (reader *Reader) AllOIDs() iter.Seq[objectid.ObjectID] {
return func(yield func(objectid.ObjectID) bool) {
positions := reader.AllPositions()
diff --git a/format/commitgraph/read/layerinfo.go b/format/commitgraph/read/layerinfo.go
index d4dbfad3..f437a1c2 100644
--- a/format/commitgraph/read/layerinfo.go
+++ b/format/commitgraph/read/layerinfo.go
@@ -9,7 +9,7 @@ type LayerInfo struct {
// Layers returns loaded layer metadata in native chain order.
//
-// Labels: Life-Independent.
+// Labels: MT-Safe, Life-Independent.
func (reader *Reader) Layers() []LayerInfo {
out := make([]LayerInfo, 0, len(reader.layers))
for i := range reader.layers {
diff --git a/format/commitgraph/read/lookup.go b/format/commitgraph/read/lookup.go
index 5f1b08f6..91a505e1 100644
--- a/format/commitgraph/read/lookup.go
+++ b/format/commitgraph/read/lookup.go
@@ -6,6 +6,8 @@ import (
)
// Lookup resolves one object ID to one graph position.
+//
+// Labels: MT-Safe.
func (reader *Reader) Lookup(oid objectid.ObjectID) (Position, error) {
if oid.Algorithm() != reader.algo {
return Position{}, &NotFoundError{OID: oid}
diff --git a/format/commitgraph/read/oidat.go b/format/commitgraph/read/oidat.go
index 99259995..631002d9 100644
--- a/format/commitgraph/read/oidat.go
+++ b/format/commitgraph/read/oidat.go
@@ -7,7 +7,7 @@ import (
// OIDAt returns object ID at one position.
//
-// Labels: Life-Independent.
+// Labels: MT-Safe, Life-Independent.
func (reader *Reader) OIDAt(pos Position) (objectid.ObjectID, error) {
layer, err := reader.layerByPosition(pos)
if err != nil {
diff --git a/format/commitgraph/read/reader.go b/format/commitgraph/read/reader.go
index 7a8659c1..03698eb1 100644
--- a/format/commitgraph/read/reader.go
+++ b/format/commitgraph/read/reader.go
@@ -4,7 +4,7 @@ import objectid "codeberg.org/lindenii/furgit/object/id"
// Reader provides read-only access to one mmap-backed commit-graph snapshot.
//
-// Labels: MT-ReadSafe, Close-Caller.
+// Labels: MT-Safe, Close-Caller.
type Reader struct {
algo objectid.Algorithm
hashVersion uint8