• Stars
    star
    64
  • Rank 462,301 (Top 10 %)
  • Language
    Elixir
  • Created about 9 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

More Repositories

1

reaxt

Use React template into your Elixir application for server rendering
Elixir
366
star
2

sweet_xml

Elixir
351
star
3

elixir.nvim

Vim Completion/Doc/Eval for Elixir (nvim), compile https://github.com/awetzel/neovim-elixir and https://github.com/awetzel/nvim-rplugin
Vim Script
103
star
4

ewebmachine

The HTTP decision tree as a plug (full elixir rewriting of basho/webmachine with improvements)
CSS
98
star
5

exos

Exos is a simple Port Wrapper : a GenServer which forwards cast and call to a linked Port.
Elixir
77
star
6

node_erlastic

Node library to make nodejs gen_server in Erlang/Elixir through Port connection
JavaScript
73
star
7

neovim-elixir

Neovim host plugin for Elixir (use https://github.com/awetzel/elixir.nvim for a packaged version)
Elixir
69
star
8

mailibex

Library containing Email related implementations in Elixir : dkim, spf, dmark, mimemail, smtp
Elixir
59
star
9

nano_ring

NanoRing is a very very small Cluster management System in Elixir.
Elixir
35
star
10

clojure-erlastic

Micro lib making use of erlang JInterface lib to decode and encode Binary Erlang Term and simple erlang port interface with core.async channel. So you can communicate with erlang coroutine with clojure abstraction
Clojure
33
star
11

reaxt-example

An example and test application for "reaxt", the react integration for elixir
JavaScript
30
star
12

delayed_otp

Delay death of supervisor children or gen_server : for instance Erlang supervisor with exponential backoff restart strategy
Elixir
24
star
13

plug_forwarded_peer

Very simple plug which reads `X-Forwarded-For` or `Forwarded` header according to rfc7239 and fill `conn.remote_ip` with the root client ip.
Elixir
23
star
14

supervisorring

otp/supervisor-like interface to supervise distributed processes
Elixir
16
star
15

adap

Create a data stream across your information systems to query, augment and transform data according to Elixir matching rules.
Elixir
16
star
16

calibex

Elixir ICal : bijective coding/decoding for ICal transformation, ICal email request and responses.
Elixir
14
star
17

rulex

This tiny library (2 macros only) allows you to define very simple rule handler using Elixir pattern matching.
Elixir
13
star
18

nvim-rplugin

Nvim Elixir plugin with autocompletion and eval commands
Elixir
9
star
19

exfsm

Simple elixir library to define a static FSM.
Elixir
9
star
20

dotx

Dotx is a library for DOT file parsing and generation. The whole spec https://www.graphviz.org/doc/info/lang.html is implemented.
Elixir
8
star
21

stemex

Stemex is a NIF wrapper above the snowball language (http://snowball.tartarus.org)
C
7
star
22

zip_stream

Library to read zip file in a stream. Zip file binary stream -> stream of {:new_file,name} or uncompressed_bin Erlang zlib library only allows deflate decompress stream. But Erlang zip library does not allow content streaming.
HTML
7
star
23

json_stream

Small but useful wrapper above erlang `jsx` to stream json elements from an Elixir binary stream.
Elixir
6
star
24

nox

Node / npm wrapper
Elixir
5
star
25

babel-plugin-transform-jsxz

Write your JSX for your HTML components using successive transformations targeted with CSS selector at compilation time - in the same way that enlive templates work. As a Babel transform plugin.
JavaScript
4
star
26

bert_view

Chrome Extension to have a pretty view of binary erlang term in HTTP service
JavaScript
2
star
27

arcore

Arcore OS, the very simple Kbrw Immutable OS - linux distribution based on Systemd and Runc.
Shell
2
star
28

jsxz-loader

JSXZ Loader allows you to Precompile your JSX HTML components from static HTML templates using CSS selectors.
JavaScript
1
star
29

elixir-sandbox

Elixir
1
star
30

qrcode

Erlang
1
star