ProductPromotion
Logo

Elixir

made by https://0x3d.site

GitHub - kbrw/gitex: Elixir implementation of the Git object storage, but with the goal to implement the same semantic with other storage and topics
Elixir implementation of the Git object storage, but with the goal to implement the same semantic with other storage and topics - kbrw/gitex
Visit Site

GitHub - kbrw/gitex: Elixir implementation of the Git object storage, but with the goal to implement the same semantic with other storage and topics

GitHub - kbrw/gitex: Elixir implementation of the Git object storage, but with the goal to implement the same semantic with other storage and topics

Gitex Build Status

See API documentation at http://hexdocs.pm/gitex.

  • Reference implementation in pure Elixir of the Git object model and storage, including optimized pack-refs and pack-objects/deltas).
  • Protocol over Git codec and backend to customize them and reuse the same versioning logic in a completely different environment and use case: JSON into Riak for instance.

TODO:

  • test it (only for regression, currently it works on many open source git repo, so it can be considered as tested)
  • add a Gitex.merge helper to help you construct a commit tree from multiple trees
  • add impl Gitex.Repo for Pid as a GenServer RPC
  • implementation example of previous GenServer maintaining ETS LRU cache of standard git fs objects and deltas
  • add some useful alternative implementations, currently only standard object encoding and storage

Usage example

r = Gitex.Git.open #Gitex.Git is the .git fs object storage
Gitex.get("master",r) #get commit
Gitex.get("myannotatedtag",r) #get tag object
Gitex.get("master",r,"/path/to/dir")  #get tree object
Gitex.get("master",r,"/path/to/file") #get blob

# get all commits from master to 1st January 2015
Gitex.history("master",r) 
|> Enum.take_while(& &1.committer.utc_time > {{2015,1,1},{0,0,0}})

# get the stream of version history of a given file
Gitex.history("master",r) 
|> Stream.map(&Gitex.get_hash(&1,r,"/path/to/file")) 
|> Stream.dedup
|> Stream.map(&Gitex.object(&1,r))

# commit history stream is powerful, play with it

Gitex.get("master",r) # return commit
|> Gitex.put(r,"/some/path/file1","file1 content") #put new trees and return new root tree hash
|> Gitex.put(r,"/some/other/path/file2","file2 content") ##put new trees and return new root tree hash
|> Gitex.commit(r,"master","some commit message") #save tree in a commit with "master" parent then update "master" and return commit hash 
|> Gitex.tag(r,"mytag") # save this commit to a soft tag return commit_tag
|> Gitex.tag(r,"myannotatedtag","my message") # save this commit to a tag object with comment, return tag hash

# Currently "put" is the only helper to construct a new "tree", for merging you have to construct the tree yourself

A nice function Gitex.align_history allows you to lazily add an index number to your history stream in order to construct a pretty visualizer very easily (d3.js for instance)

Gitex.history(:head,repo) |> Gitex.align_history

The Gitex.Repo protocol

Any repo implementing the Gitex.Repo protocol : (basically object codec, ref setter/resolver, binary get/put) can be managed with the Gitex API.

CONTRIBUTING

Hi, and thank you for wanting to contribute. Please refer to the centralized informations available at: https://github.com/kbrw#contributing

Articles
to learn more about the elixir concepts.

Resources
which are currently available to browse on.

mail [email protected] to add your project or resources here 🔥.

FAQ's
to know more about the topic.

mail [email protected] to add your project or resources here 🔥.

Queries
or most google FAQ's about Elixir.

mail [email protected] to add more queries here 🔍.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory