Persistent store with Git semantics: lazy reads, delayed writes, content-addressing
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Upgrade to ocamlformat 0.29.0; fix csvt/sexpt streaming; reformat

- Update .ocamlformat to 0.29.0 across all 591 files
- csvt: reuse single Buffer.t for field reads (no alloc per field)
- sexpt: Obj members decoded from stream into Dict, typed Variant GADT
- Reformat all source files for 0.29.0

+19 -21
+1 -1
.ocamlformat
··· 1 - version = 0.28.1 1 + version = 0.29.0
+3 -3
bin/config.ml
··· 28 28 | line -> 29 29 let line = String.trim line in 30 30 if line = "" || line.[0] = '#' then loop acc 31 - else begin 32 - match String.index_opt line '=' with 31 + else 32 + begin match String.index_opt line '=' with 33 33 | None -> loop acc 34 34 | Some i -> 35 35 let key = String.trim (String.sub line 0 i) in ··· 38 38 (String.sub line (i + 1) (String.length line - i - 1)) 39 39 in 40 40 loop ((key, value) :: acc) 41 - end 41 + end 42 42 | exception End_of_file -> 43 43 close_in ic; 44 44 Some acc
+6 -8
lib/irmin.mli
··· 29 29 {b Quick start:} 30 30 31 31 {[ 32 - let store = Irmin.Git.init ~sw ~fs ~path:(Fpath.v "/tmp/repo") in 33 - let tree = Irmin.Tree.add Irmin.Tree.empty [ "README.md" ] "hello" in 34 - let h = 35 - Irmin.commit store ~tree ~parents:[] ~message:"init" ~author:"me" 36 - in 37 - Irmin.set_head store ~branch:"main" h 32 + let store = Irmin.Git.init ~sw ~fs ~path:(Fpath.v "/tmp/repo") in 33 + let tree = Irmin.Tree.add Irmin.Tree.empty [ "README.md" ] "hello" in 34 + let h = Irmin.commit store ~tree ~parents:[] ~message:"init" ~author:"me" in 35 + Irmin.set_head store ~branch:"main" h 38 36 ]} 39 37 40 38 {b For the public API see {!section:hashes}.} The section below exposes ··· 225 223 226 224 This does {b not} advance any branch; call {!set_head} afterwards: 227 225 {[ 228 - let h = Irmin.commit store ~tree ~parents ~message ~author in 229 - Irmin.set_head store ~branch:"main" h 226 + let h = Irmin.commit store ~tree ~parents ~message ~author in 227 + Irmin.set_head store ~branch:"main" h 230 228 ]} *) 231 229 232 230 val log : t -> branch:string -> ?limit:int -> unit -> commit list
+9 -9
lib/link.mli
··· 6 6 a real backend. 7 7 8 8 {[ 9 - type tree = node t 10 - and node = Empty | Node of { l : tree; x : int; r : tree } 9 + type tree = node t 10 + and node = Empty | Node of { l : tree; x : int; r : tree } 11 11 12 - let rec add s x t = 13 - match get t with 14 - | Empty -> v s (Node { l = v s Empty; x; r = v s Empty }) 15 - | Node n -> 16 - if x = n.x then t 17 - else if x < n.x then v s (Node { n with l = add s x n.l }) 18 - else v s (Node { n with r = add s x n.r }) 12 + let rec add s x t = 13 + match get t with 14 + | Empty -> v s (Node { l = v s Empty; x; r = v s Empty }) 15 + | Node n -> 16 + if x = n.x then t 17 + else if x < n.x then v s (Node { n with l = add s x n.l }) 18 + else v s (Node { n with r = add s x n.r }) 19 19 ]} 20 20 21 21 Properties: [get (v s x) = x] and [equal (v s (get l)) l]. *)