[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MirageOS-devel] Question: How to generate History like CueKeeper does?

Thanks a lot, Thomas! That was definitely helpful and helped me get unstuck.

I see now that `fill_cache` iterates over the tree/files in master (or a specified remote branch) and then gets the create and update times for each of those files by iterating over every commit in history. 

By the way, Irmin looks great and looking forward to using it more!


On Sun, Nov 6, 2016 at 7:41 AM, Thomas Gazagnaire <thomas@xxxxxxxxxxxxxx> wrote:

> I'm trying to implement a 'recent activity' feed in Canopy(https://github.com/Engil/Canopy) which uses Irmin as datastore. It stores data in-memory
>  and populates the store with data from a remote Git repository. Will `Store.iter` iterate through each commit that was in the repo?

Store.iter will only iterate over the tree/files of the commit that you are considering.

The full history is available via Store.History. Luckily for you, Engil already wrote a function iterating over the history which is used to find the date of creation of a file, you can see it here:


In that function, `key` is the file that you want to know things about, and the `aux` function iterated over every commit to find the creation and update times of that file.

Topological.fold is defined in OCamlGraph: http://ocamlgraph.lri.fr/doc/Topological.Make.html#VALfold

Hope this helps,

Gabe Jaldon

MirageOS-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.