···11(** [irmin clone] - create a new store seeded from a CAR file.
2233- Given a CAR snapshot (typically produced by [irmin export] or a
44- PDS's [com.atproto.sync.getRepo] endpoint), initialise a fresh
55- local store at [DIR] and import every block from the archive.
66- The store's head is bound to the first root CID in the CAR.
33+ Given a CAR snapshot (typically produced by [irmin export] or a PDS's
44+ [com.atproto.sync.getRepo] endpoint), initialise a fresh local store at
55+ [DIR] and import every block from the archive. The store's head is bound to
66+ the first root CID in the CAR.
7788 This is the one-shot counterpart to [init] + [import] + [set_head].
991010- URL support (fetching the CAR over HTTP from a live PDS endpoint)
1111- is not implemented yet; for now [SOURCE] must be a path to a local
1212- CAR file. *)
1010+ URL support (fetching the CAR over HTTP from a live PDS endpoint) is not
1111+ implemented yet; for now [SOURCE] must be a path to a local CAR file. *)
13121413let err_not_car path =
1514 Common.error "clone: SOURCE must be a .car file; got %a" Common.styled_cyan
···5655 Pds.set_head pds head_cid;
5756 Pds.close pds;
5857 Common.success "Cloned %d blocks into %a (HEAD %s)" !count
5959- Common.styled_cyan dir (Atp.Cid.to_string head_cid);
5858+ Common.styled_cyan dir
5959+ (Atp.Cid.to_string head_cid);
6060 0
61616262let run ~source dir =
···6767 let fs = Eio.Stdenv.cwd env in
6868 Eio.Switch.run @@ fun sw ->
6969 match Eio.Path.kind ~follow:false Eio.Path.(fs / dir) with
7070- | `Not_found | `Directory when not (Sys.file_exists dir)
7171- || Sys.readdir dir = [||] ->
7070+ | (`Not_found | `Directory)
7171+ when (not (Sys.file_exists dir)) || Sys.readdir dir = [||] ->
7272 do_clone ~sw ~fs ~source ~dir
7373 | _ -> err_dir_exists dir
7474···9292 `S Manpage.s_description;
9393 `P
9494 "Initialise a fresh store at DIR and import every block from the CAR \
9595- archive at SOURCE. The store's HEAD is bound to the first root CID \
9696- in the archive.";
9595+ archive at SOURCE. The store's HEAD is bound to the first root CID in \
9696+ the archive.";
9797 `P
9898 "DIR must not exist, or must be empty. This mirrors the safety \
9999 behaviour of [git clone].";
+7-9
bin/cmd_export.ml
···11(** [irmin export] - snapshot a store as a CAR file.
2233 Writes every block reachable from the store's head to a CAR
44- (Content-Addressable aRchive) file. The resulting file is a
55- portable, hash-integral snapshot — it can be emailed, archived,
66- or later [import]ed into any store that accepts CAR input.
44+ (Content-Addressable aRchive) file. The resulting file is a portable,
55+ hash-integral snapshot — it can be emailed, archived, or later [import]ed
66+ into any store that accepts CAR input.
7788- Today only the PDS/ATProto backend is implemented. Git-backed
99- stores fail with a clear "backend not supported" message; Git
1010- export should use [git bundle] on the underlying [.git]
1111- directory. *)
88+ Today only the PDS/ATProto backend is implemented. Git-backed stores fail
99+ with a clear "backend not supported" message; Git export should use
1010+ [git bundle] on the underlying [.git] directory. *)
12111312let err_unsupported_backend backend =
1413 Common.error
···4039 Eio.Switch.run @@ fun sw ->
4140 match config.Config.backend with
4241 | Config.Pds -> export_pds ~sw ~fs ~config file
4343- | Config.Git | Config.Memory | Config.Disk as b ->
4444- err_unsupported_backend b
4242+ | (Config.Git | Config.Memory | Config.Disk) as b -> err_unsupported_backend b
45434644open Cmdliner
4745
+3-3
bin/cmd_import.ml
···11(** [irmin import] - import a CAR file into the store.
2233- Today only CAR (Content-Addressable aRchive) files are supported:
44- every block in the CAR is written to the store's [.irmin/blocks]
55- filesystem blockstore. Other formats fail fast with a clear error. *)
33+ Today only CAR (Content-Addressable aRchive) files are supported: every
44+ block in the CAR is written to the store's [.irmin/blocks] filesystem
55+ blockstore. Other formats fail fast with a clear error. *)
6677let err_unsupported_format file =
88 Common.error "import: only .car files are supported; got %a"