{"id":13509749,"url":"https://github.com/kbrw/gitex","last_synced_at":"2025-12-12T00:27:24.301Z","repository":{"id":29174263,"uuid":"32704922","full_name":"kbrw/gitex","owner":"kbrw","description":"Elixir implementation of the Git object storage, but with the goal to implement the same semantic with other storage and topics","archived":false,"fork":false,"pushed_at":"2021-10-29T15:34:04.000Z","size":40,"stargazers_count":66,"open_issues_count":5,"forks_count":5,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-04-14T04:10:26.383Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kbrw.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-23T01:33:47.000Z","updated_at":"2024-04-12T05:09:30.000Z","dependencies_parsed_at":"2022-08-17T20:05:10.600Z","dependency_job_id":null,"html_url":"https://github.com/kbrw/gitex","commit_stats":null,"previous_names":["awetzel/gitex"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kbrw%2Fgitex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kbrw%2Fgitex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kbrw%2Fgitex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kbrw%2Fgitex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kbrw","download_url":"https://codeload.github.com/kbrw/gitex/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251473214,"owners_count":21595024,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T02:01:12.322Z","updated_at":"2025-12-12T00:27:24.243Z","avatar_url":"https://github.com/kbrw.png","language":"Elixir","funding_links":[],"categories":["Version Control"],"sub_categories":[],"readme":"Gitex [![Build Status](https://travis-ci.org/kbrw/gitex.svg)](https://travis-ci.org/kbrw/gitex)\n=======\n\nSee API documentation at [http://hexdocs.pm/gitex](http://hexdocs.pm/gitex).\n\n- Reference implementation in pure Elixir of the Git object model and storage,\n  including optimized pack-refs and pack-objects/deltas).\n- Protocol over Git codec and backend to customize them and reuse the same\n  versioning logic in a completely different environment and use case: JSON\n  into Riak for instance.\n\nTODO:\n\n- test it (only for regression, currently it works on many open source git repo, so it can be considered as tested)\n- add a `Gitex.merge` helper to help you construct a commit tree from multiple trees\n- add impl `Gitex.Repo` for Pid as a GenServer RPC\n- implementation example of previous GenServer maintaining ETS LRU cache of standard git fs objects and deltas\n- add some useful alternative implementations, currently only standard object encoding and storage\n\n## Usage example\n\n\n```elixir\nr = Gitex.Git.open #Gitex.Git is the .git fs object storage\nGitex.get(\"master\",r) #get commit\nGitex.get(\"myannotatedtag\",r) #get tag object\nGitex.get(\"master\",r,\"/path/to/dir\")  #get tree object\nGitex.get(\"master\",r,\"/path/to/file\") #get blob\n\n# get all commits from master to 1st January 2015\nGitex.history(\"master\",r) \n|\u003e Enum.take_while(\u0026 \u00261.committer.utc_time \u003e {{2015,1,1},{0,0,0}})\n\n# get the stream of version history of a given file\nGitex.history(\"master\",r) \n|\u003e Stream.map(\u0026Gitex.get_hash(\u00261,r,\"/path/to/file\")) \n|\u003e Stream.dedup\n|\u003e Stream.map(\u0026Gitex.object(\u00261,r))\n\n# commit history stream is powerful, play with it\n\nGitex.get(\"master\",r) # return commit\n|\u003e Gitex.put(r,\"/some/path/file1\",\"file1 content\") #put new trees and return new root tree hash\n|\u003e Gitex.put(r,\"/some/other/path/file2\",\"file2 content\") ##put new trees and return new root tree hash\n|\u003e Gitex.commit(r,\"master\",\"some commit message\") #save tree in a commit with \"master\" parent then update \"master\" and return commit hash \n|\u003e Gitex.tag(r,\"mytag\") # save this commit to a soft tag return commit_tag\n|\u003e Gitex.tag(r,\"myannotatedtag\",\"my message\") # save this commit to a tag object with comment, return tag hash\n\n# Currently \"put\" is the only helper to construct a new \"tree\", for merging you have to construct the tree yourself\n```\n\nA nice function `Gitex.align_history` allows you to lazily add an index number to your\nhistory stream in order to construct a pretty visualizer very easily (d3.js for instance)\n\n```elixir\nGitex.history(:head,repo) |\u003e Gitex.align_history\n```\n\n## The Gitex.Repo protocol\n\nAny repo implementing the `Gitex.Repo` protocol : (basically object codec, ref\nsetter/resolver, binary get/put) can be managed with the `Gitex` API.\n\n# CONTRIBUTING\n\nHi, and thank you for wanting to contribute.\nPlease refer to the centralized informations available at: https://github.com/kbrw#contributing\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkbrw%2Fgitex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkbrw%2Fgitex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkbrw%2Fgitex/lists"}