Ogit is a university project based on git but coded in Ocaml, a general-purpose and multi-paradigm programming language
Compile it with :
> ocamlc objects.mli logs.mli commands.mli
> ocamlfind opt -linkpkg -package unix -o ogit ogit objects.ml logs.ml commands.ml ogit.ml
Use :
> ./ogit Ogit -c [command]
- Ogit -c init
- Ogit -c commit "message"
- Ogit -c merge "hash"
- Ogit -c checkout "hash"
- Ogit-c log
Ogit is currently using these OCaml Libraries :
Libraries | Documentation |
---|---|
List | OCaml Library : List |
Array | OCaml Library : Array |
String | OCaml Library : String |
Sys | OCaml Library : Sys |
Unix | OCaml Library : Unix |
Arg | OCaml Library : Arg |
Digest | Ocaml Library : Digest |
Printf | OCaml Library : Printf |
Filename | OCaml Library : Filename |
What's a difficulty-free project ? Here are some difficulties we had during this project:
-
First, we had a lot of problems with dune, It took us a while to understand dune.
-
We found that utop can't show us the hash of an empty string (""). It makes it crash
-
Before, we was compiling function by function and it took us so much time until we found the magic command
dune utop
-
We had to seperate the hash function in two due to the typing of the hash function
-
We prefered to use Sys.command to write to the files so we can use the -n option of echo to not have the final \n and so we can handle errors. If there's an error (by example if the user doesn't have enough perms), the code result will not be 0 (=success) and it'll fail with the message "erreur"
-
For the store_work_directory function, we had to make a function to convert a Directory to a Type t called dir_t_to_object
-
The log_graph has some problem with some specific tests
-
clean_work_directory was a challenge to remove everything except hidden files with the best complexity and we did it with a shell command
find . -not -path "*/.*" -delete
- Mr. BOUSSIK
- Mr. SAVASTA
- Mr. ESCOBAR
Special thanks to our teachers :
- Mr. LOZES
- Ms. PELLEAU
- Mr. URSO