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

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



Hi,

> 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:

https://github.com/Engil/Canopy/blob/b93dad3591a1d1edfbd998dc651b7a44ea8a416a/canopy_store.ml#L63-L78

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,
Thomas


_______________________________________________
MirageOS-devel mailing list
MirageOS-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/cgi-bin/mailman/listinfo/mirageos-devel

 


Rackspace

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