Comments (2)
Thanks for your suggestion. For a future reader, the full code I now use is:
let push_to_branch repository ~branch data =
let config = Irmin_git.config repository in
Store.Repo.v config >>= fun repo ->
Store.of_branch repo branch >>= fun s ->
Store.tree s >>= fun tree ->
M.fold (fun k v tree ->
tree >>= fun tree ->
Store.Tree.add tree (String.split_on_char '/' k) v)
data (Lwt.return tree) >>= fun tree ->
let info =
let author = "Canopy bot <[email protected]>" in
Irmin_git_unix.info ~author "%s" "updated" ()
in
(Store.Head.find s >|= function
| None -> []
| Some commit -> [ Commit.key commit ]) >>= fun parents ->
Store.Commit.v repo ~info ~parents tree >>= fun commit ->
Store.Head.set s commit
Thanks again @Ngoguey42
from irmin.
Hi.
In order to batch operations under a single commit you need to use the irmin trees:
Store.of_branch repo branch >>= fun s ->
Store.tree s >>= fun tree ->
(* add one contents at a time *)
Store.Tree.add tree (String.split_on_char '/' k) v >>= fun tree ->
Store.Commit.v repo ~info ~parents tree >>= fun _commit ->
I hope it helps.
from irmin.
Related Issues (20)
- LICENSE file discrepency HOT 3
- irmin-pack: improve client experience when calling integrity check
- irmin-pack: handle LRU purge in read-only instances after a GC
- Invalid conduit source address specified HOT 2
- irmin-pack: improve control file's atomic write properties HOT 1
- irmin-pack: extend GC to unlimited history stores HOT 1
- irmin-pack: integrity check doesn't use ppf for results handling
- index: readonly index creates a folder
- irmin-pack: Unlink can be slow HOT 1
- irmin-pack: change the default indexing strategy
- irmin-pack: clean up OS-specific output for integrity check logging
- irmin-cli: change `--store irf` to `--store fs`
- irmin-cli creates broken git repository HOT 10
- irmin-pack: implement `fresh` for lower layer
- Performance issue in Tree.length HOT 1
- Pack_error: "Invalid_argument" when calling `integrity-check-index` command
- invalid checksum when using irmin-pack HOT 1
- irmin-pack: error `unknown inode key`
- Tutorial - CLI- GraphQL snippet HOT 1
- libirmin fails to build with OCaml 5.2 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from irmin.