Oshiro's git: VCS written in Haskell that tries to be compatible with git.
This is not safe to use, and if you use it in serious repositories you probably will say: "Oshit!". This is only meant for learning how git works and how hard it is.
This project can be built from source using GNU Make, Stack, or Cabal. When building with GNU Make, you'll have to manage Haskell dependencies on your own. The Makefile was written with Arch / Manjaro in mind, so dynamic linking is used, as haskell packages on those distros no longer ship archives for static linking.
With Stack installed, the build process is as simple as:
$ stack build
If you're using Cabal directly instead, make sure you have a compatible version of GHC installed and run the usual:
$ cabal build
Installing is possible with both through their install
commands.
As mentioned before, you're on your own here when it comes to managing dependencies. If you're on Arch or Manjaro, your mileage may vary, but these should prove sufficient:
ghc
make
haskell-zlib
haskell-cryptohash
haskell-base16-bytestring
haskell-unix-compat
haskell-split
Install them with the usual sudo pacman -S
.
The oficial versions of the packages needed to build and run Oshit can be outdated! Be careful! Try to install them through other sources, such as cabal or stack!
I'm providing here a Dockerfile based on Arch, if you prefer.
Only in the root of your project, run [oshit path]/oshit [<command>] [<args>]
We provide a Dockerfile, which may be safer and contains all the dependencies pre-installed. On the root of the project, run
docker build -t oshit .
for build the oshit
Docker image. For executing it, run:
docker run -v "[oshit path]:/oshit" -e OSHIT_AUTHOR=[author] -e OSHIT_EMAIL=[email] -it oshit
log
: similar togit log
. You can provide a hash, or call without parameters.commit
: similar togit commit
. It will call the default text editor for the commit messageadd
: similar togit add
. You must provide a file!branch
: similar togit branch
. Without arguments, show branches. With an argument, create a branchreflog
: similar togit reflog
. Without parameters, show HEAD reflog. Otherwise, show reflog for the branchcherry-pick
: similar togit cherry-pick
commit-from-tree
: similiar togit commit-tree
. Creates a commit for a tree.create-blob
: similar togit hash-object -w --stdin
. Creates a blob object.show-obj
: similar togit cat-file -p
. Show object contentsadd-blob
: similar togit update-info --add --cacheinfo 100644
. Adds a blob to the index. A hash and a filename must be provided.tree-from-index
: similar togit write-tree
. Creates a tree based on the index contents.update-branch
: similar togit update-ref
, but only for branches.update-head
: similar togit update-ref HEAD
list-tree
: similar togit ls-tree
merge-tree
: performs a three way merge using three trees, and returns the merged treemerge-commit
: performs a three way merge using three commits, and returns a merge commit