Skip to content

Commit

Permalink
Merge pull request #13 from samoht/mirage
Browse files Browse the repository at this point in the history
Mirage
  • Loading branch information
samoht committed Jun 9, 2014
2 parents 46d6526 + 6c92e64 commit c7132dd
Show file tree
Hide file tree
Showing 49 changed files with 899 additions and 470 deletions.
11 changes: 7 additions & 4 deletions .travis-ci.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
# OPAM packages needed to build tests.
OPAM_PACKAGES="camlzip dolog core_kernel cryptokit uri \
cmdliner lazy-trie mstruct re ocamlgraph \
alcotest lwt conduit uri"
cmdliner sha mstruct re ocamlgraph \
alcotest lwt \
conduit uri mirage-fs-unix io-page ipaddr"

ppa=avsm/ocaml41+opam11
echo "yes" | sudo add-apt-repository ppa:$ppa
sudo apt-get update -qq
sudo apt-get install -qq ocaml ocaml-native-compilers camlp4-extra opam
export OPAMYES=1

opam init https://github.com/ocaml/opam-repository.git
opam init git://github.com/ocaml/opam-repository >/dev/null 2>&1
opam install ${OPAM_PACKAGES}
opam list

eval `opam config env`
ocaml setup.ml -configure --enable-tests
ls $(ocamlfind query mirage-types)
./configure --enable-tests --enable-mirage
make
make test
11 changes: 7 additions & 4 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
1.2.0:
1.2.0: (2014-06-10)
* Can consume Mirage's V1_LWT.FS signature to generate a
persistent store. This allows to store Git repos directly
inside raw block devices (no need of filesystem anymore).
* Minor API refactoring to abstract the unix layer cleanly
* Expose a filesystem functor to create filesystem backends
independent of unix
* Simplify the ocamlfind packages: there's only git and git.unix

1.1.0:
1.1.0: (2014-06-02)
* Support for push (not optimized at all)
* Fix the generation of `.dot` file representing the Git repo
* Fix serialization of executable files in the cache
Expand All @@ -14,11 +17,11 @@
* Depend the implementation of patience diff in pure OCaml
(unused for now)

1.0.2:
1.0.2: (2014-04-19)
* Catch, improve and propagate Zlib inflation errors
(which usually on incomplete files)

1.0.1: (2013-04-10)
1.0.1: (2014-04-10)
* Escape invalid chars in path names
* Do not link with camlp4 when using as a libray

Expand Down
19 changes: 10 additions & 9 deletions _oasis
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ Library git
Pack: true
Path: lib/
Findlibname: git
Modules: SHA1, Blob, Cache, Commit, Misc,
Modules: SHA, Blob, Cache, Commit, Misc,
Global_graph, Pack, Pack_index, Packed_value,
Reference, Sync, Tag, Tree, User, Value,
Object, Object_type, Store, Search, Gri,
Memory, FS
BuildDepends: mstruct, dolog, core_kernel, ocamlgraph, lazy-trie,
re.pcre, zip, cryptokit, uri, lwt,
BuildDepends: mstruct, dolog, core_kernel, ocamlgraph,
re.pcre, zip, sha, uri, lwt,
bin_prot.syntax, comparelib.syntax, sexplib.syntax,
conduit.lwt, uri.services
XMETARequires: mstruct, dolog, core_kernel, ocamlgraph, lazy-trie,
re.pcre, zip, cryptokit, uri, lwt,
XMETARequires: mstruct, dolog, core_kernel, ocamlgraph,
re.pcre, zip, sha, uri, lwt,
conduit.lwt, uri.services

Library "git-unix"
Expand All @@ -46,7 +46,7 @@ Library "git-mirage"
FindlibParent: git
Findlibname: mirage
Modules: Git_mirage
BuildDepends: git, mirage.types
BuildDepends: git, mirage-types.lwt, io-page

Executable ogit
Build$: flag(unix)
Expand All @@ -57,14 +57,15 @@ Executable ogit
BuildDepends: cmdliner, git, git.unix

Executable test_git
Build$: flag(tests) && flag(unix)
Build$: flag(tests) && flag(unix) && flag(mirage)
Path: lib_test
MainIs: test.ml
CompiledObject: best
Install: false
BuildDepends: alcotest, git, git.unix
BuildDepends: alcotest, git, git.unix, cryptokit,
git.mirage, io-page.unix, mirage-fs-unix

Test test_git
Run$: flag(tests)
Run$: flag(tests) && flag(unix) && flag(mirage)
Command: $test_git -q
WorkingDirectory: lib_test/
33 changes: 22 additions & 11 deletions _tags
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# OASIS_START
# DO NOT EDIT (digest: 0d39513a68176676ea0381dfeb62c76d)
# DO NOT EDIT (digest: 0216bcc876c5cc9c342039b0c69188fb)
# Ignore VCS directories, you can use the same kind of rule outside
# OASIS_START/STOP if you want to exclude directories that contains
# useless stuff for the build process
Expand All @@ -15,7 +15,7 @@
"_darcs": not_hygienic
# Library git
"lib/git.cmxs": use_git
"lib/SHA1.cmx": for-pack(Git)
"lib/SHA.cmx": for-pack(Git)
"lib/blob.cmx": for-pack(Git)
"lib/cache.cmx": for-pack(Git)
"lib/commit.cmx": for-pack(Git)
Expand All @@ -39,19 +39,22 @@
"lib/FS.cmx": for-pack(Git)
# Library git-unix
"lib/git-unix.cmxs": use_git-unix
<lib/*.ml{,i}>: pkg_lwt.unix
# Library git-mirage
"lib/git-mirage.cmxs": use_git-mirage
<lib/*.ml{,i}>: pkg_bin_prot.syntax
<lib/*.ml{,i}>: pkg_comparelib.syntax
<lib/*.ml{,i}>: pkg_conduit.lwt
<lib/*.ml{,i}>: pkg_core_kernel
<lib/*.ml{,i}>: pkg_cryptokit
<lib/*.ml{,i}>: pkg_dolog
<lib/*.ml{,i}>: pkg_lazy-trie
<lib/*.ml{,i}>: pkg_io-page
<lib/*.ml{,i}>: pkg_lwt
<lib/*.ml{,i}>: pkg_lwt.unix
<lib/*.ml{,i}>: pkg_mirage-types.lwt
<lib/*.ml{,i}>: pkg_mstruct
<lib/*.ml{,i}>: pkg_ocamlgraph
<lib/*.ml{,i}>: pkg_re.pcre
<lib/*.ml{,i}>: pkg_sexplib.syntax
<lib/*.ml{,i}>: pkg_sha
<lib/*.ml{,i}>: pkg_uri
<lib/*.ml{,i}>: pkg_uri.services
<lib/*.ml{,i}>: pkg_zip
Expand All @@ -62,15 +65,14 @@
<bin/ogit.{native,byte}>: pkg_comparelib.syntax
<bin/ogit.{native,byte}>: pkg_conduit.lwt
<bin/ogit.{native,byte}>: pkg_core_kernel
<bin/ogit.{native,byte}>: pkg_cryptokit
<bin/ogit.{native,byte}>: pkg_dolog
<bin/ogit.{native,byte}>: pkg_lazy-trie
<bin/ogit.{native,byte}>: pkg_lwt
<bin/ogit.{native,byte}>: pkg_lwt.unix
<bin/ogit.{native,byte}>: pkg_mstruct
<bin/ogit.{native,byte}>: pkg_ocamlgraph
<bin/ogit.{native,byte}>: pkg_re.pcre
<bin/ogit.{native,byte}>: pkg_sexplib.syntax
<bin/ogit.{native,byte}>: pkg_sha
<bin/ogit.{native,byte}>: pkg_uri
<bin/ogit.{native,byte}>: pkg_uri.services
<bin/ogit.{native,byte}>: pkg_zip
Expand All @@ -81,15 +83,14 @@
<bin/*.ml{,i}>: pkg_comparelib.syntax
<bin/*.ml{,i}>: pkg_conduit.lwt
<bin/*.ml{,i}>: pkg_core_kernel
<bin/*.ml{,i}>: pkg_cryptokit
<bin/*.ml{,i}>: pkg_dolog
<bin/*.ml{,i}>: pkg_lazy-trie
<bin/*.ml{,i}>: pkg_lwt
<bin/*.ml{,i}>: pkg_lwt.unix
<bin/*.ml{,i}>: pkg_mstruct
<bin/*.ml{,i}>: pkg_ocamlgraph
<bin/*.ml{,i}>: pkg_re.pcre
<bin/*.ml{,i}>: pkg_sexplib.syntax
<bin/*.ml{,i}>: pkg_sha
<bin/*.ml{,i}>: pkg_uri
<bin/*.ml{,i}>: pkg_uri.services
<bin/*.ml{,i}>: pkg_zip
Expand All @@ -103,17 +104,22 @@
<lib_test/test.{native,byte}>: pkg_core_kernel
<lib_test/test.{native,byte}>: pkg_cryptokit
<lib_test/test.{native,byte}>: pkg_dolog
<lib_test/test.{native,byte}>: pkg_lazy-trie
<lib_test/test.{native,byte}>: pkg_io-page
<lib_test/test.{native,byte}>: pkg_io-page.unix
<lib_test/test.{native,byte}>: pkg_lwt
<lib_test/test.{native,byte}>: pkg_lwt.unix
<lib_test/test.{native,byte}>: pkg_mirage-fs-unix
<lib_test/test.{native,byte}>: pkg_mirage-types.lwt
<lib_test/test.{native,byte}>: pkg_mstruct
<lib_test/test.{native,byte}>: pkg_ocamlgraph
<lib_test/test.{native,byte}>: pkg_re.pcre
<lib_test/test.{native,byte}>: pkg_sexplib.syntax
<lib_test/test.{native,byte}>: pkg_sha
<lib_test/test.{native,byte}>: pkg_uri
<lib_test/test.{native,byte}>: pkg_uri.services
<lib_test/test.{native,byte}>: pkg_zip
<lib_test/test.{native,byte}>: use_git
<lib_test/test.{native,byte}>: use_git-mirage
<lib_test/test.{native,byte}>: use_git-unix
<lib_test/*.ml{,i}>: pkg_alcotest
<lib_test/*.ml{,i}>: pkg_bin_prot.syntax
Expand All @@ -122,17 +128,22 @@
<lib_test/*.ml{,i}>: pkg_core_kernel
<lib_test/*.ml{,i}>: pkg_cryptokit
<lib_test/*.ml{,i}>: pkg_dolog
<lib_test/*.ml{,i}>: pkg_lazy-trie
<lib_test/*.ml{,i}>: pkg_io-page
<lib_test/*.ml{,i}>: pkg_io-page.unix
<lib_test/*.ml{,i}>: pkg_lwt
<lib_test/*.ml{,i}>: pkg_lwt.unix
<lib_test/*.ml{,i}>: pkg_mirage-fs-unix
<lib_test/*.ml{,i}>: pkg_mirage-types.lwt
<lib_test/*.ml{,i}>: pkg_mstruct
<lib_test/*.ml{,i}>: pkg_ocamlgraph
<lib_test/*.ml{,i}>: pkg_re.pcre
<lib_test/*.ml{,i}>: pkg_sexplib.syntax
<lib_test/*.ml{,i}>: pkg_sha
<lib_test/*.ml{,i}>: pkg_uri
<lib_test/*.ml{,i}>: pkg_uri.services
<lib_test/*.ml{,i}>: pkg_zip
<lib_test/*.ml{,i}>: use_git
<lib_test/*.ml{,i}>: use_git-mirage
<lib_test/*.ml{,i}>: use_git-unix
# OASIS_STOP
true: debug, bin_annot
6 changes: 3 additions & 3 deletions bin/ogit.ml
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ let ls_remote = {
Printf.printf "From %s\n" (Gri.to_string remote);
let print ~key:ref ~data:sha1 =
Printf.printf "%s %s\n"
(SHA1.Commit.to_hex sha1)
(SHA.Commit.to_hex sha1)
(Reference.to_string ref) in
Map.iter ~f:print references;
return_unit
Expand Down Expand Up @@ -245,7 +245,7 @@ let read_tree = {
if List.exists refs ~f:(fun r -> Reference.to_string r = ref) then
S.read_reference_exn t (Reference.of_string ref)
else
return (SHA1.Commit.of_hex commit_str)
return (SHA.Commit.of_hex commit_str)
end >>= fun commit ->
S.write_cache t commit >>= fun () ->
printf "The index file has been update to %s\n%!" commit_str;
Expand Down Expand Up @@ -293,7 +293,7 @@ let clone = {
| None -> return_unit
| Some head ->
S.write_cache t head >>= fun () ->
printf "HEAD is now at %s\n" (SHA1.Commit.to_hex head);
printf "HEAD is now at %s\n" (SHA.Commit.to_hex head);
return_unit
end in
Term.(mk clone $ backend $ depth $ bare $ unpack $ remote $ directory)
Expand Down
Loading

0 comments on commit c7132dd

Please sign in to comment.