Skip to content

Moustik06/projet-pf-ogit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

69 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ogit

The Git Project codded in Ocaml

Ogit is a university project based on git but coded in Ocaml, a general-purpose and multi-paradigm programming language

Github Word

Installation

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

Run

Use :

> ./ogit Ogit -c [command]

Commands

  • Ogit -c init
  • Ogit -c commit "message"
  • Ogit -c merge "hash"
  • Ogit -c checkout "hash"
  • Ogit-c log

Libraries

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

Difficulties

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

Developers

  • Mr. BOUSSIK
  • Mr. SAVASTA
  • Mr. ESCOBAR

Acknowledgements

Special thanks to our teachers :

  • Mr. LOZES
  • Ms. PELLEAU
  • Mr. URSO

About

Small git recreated with OCaml

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages