{"id":17822110,"url":"https://github.com/samuelschlesinger/version-control","last_synced_at":"2025-03-18T12:31:39.552Z","repository":{"id":160649752,"uuid":"633946460","full_name":"SamuelSchlesinger/version-control","owner":"SamuelSchlesinger","description":"A version control system implemented from scratch in Rust.","archived":false,"fork":false,"pushed_at":"2024-10-04T04:02:04.000Z","size":38,"stargazers_count":5,"open_issues_count":8,"forks_count":2,"subscribers_count":2,"default_branch":"dev","last_synced_at":"2025-02-28T10:09:49.685Z","etag":null,"topics":["cli","command-line-interface","command-line-tool","content-addressable-storage","object-storage","rust","rust-lang","version-control"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SamuelSchlesinger.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-28T16:39:58.000Z","updated_at":"2024-12-11T16:04:28.000Z","dependencies_parsed_at":null,"dependency_job_id":"05c8cd04-f9db-45d6-be80-0861b8acb183","html_url":"https://github.com/SamuelSchlesinger/version-control","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamuelSchlesinger%2Fversion-control","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamuelSchlesinger%2Fversion-control/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamuelSchlesinger%2Fversion-control/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamuelSchlesinger%2Fversion-control/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SamuelSchlesinger","download_url":"https://codeload.github.com/SamuelSchlesinger/version-control/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243933431,"owners_count":20370986,"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":["cli","command-line-interface","command-line-tool","content-addressable-storage","object-storage","rust","rust-lang","version-control"],"created_at":"2024-10-27T17:36:05.300Z","updated_at":"2025-03-18T12:31:39.547Z","avatar_url":"https://github.com/SamuelSchlesinger.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Version Control\n\n[![Rust](https://github.com/SamuelSchlesinger/version-control/actions/workflows/rust.yml/badge.svg)](https://github.com/SamuelSchlesinger/version-control/actions/workflows/rust.yml)\n\nAn experiment to write a version control system from scratch in Rust.\n\n## CLI Usage\n\n```\nUsage: revtool \u003cCOMMAND\u003e\n\nCommands:\n  init      initialize a brand new revision\n  diff      check the difference between this branch and another\n  changes   shows the files and directories which have been changed since the latest snap\n  snap      take a new snapshot\n  checkout  switch to branch\n  branch    print out current branch\n  help      Print this message or the help of the given subcommand(s)\n\nOptions:\n  -h, --help  Print help\n```\n\n## How Does It Work?\n\nUnder the hood, it is using a content addressed binary object store in\n`.rev/store` using the [BLAKE3](https://github.com/BLAKE3-team/BLAKE3) hash\nfunction to identify binary objects using a type called `ObjectId`. Building on\ntop of that, we have a `Directory` data type which represents a directory tree\nstructure where each file's name is mapped to it's `ObjectId`. We store this\ntype directly, encoded as prettified JSON, in the object store as a commitment\nto a particular configuration or version, then we have a data type called\n`SnapShot` which links these together into a directed, acyclic graph with each\nvertex having a message attached:\n\n```\npub struct SnapShot {\n  message: String,\n  directory: ObjectId,\n  previous: ObjectId,\n}\n```\n\nWe then store this type directly in the object store as well, again as\nprettified JSON. In the `.rev/branches` directory, we keep a file for each\nbranch with the `ObjectId` of a particular encoded `SnapShot`. In\n`.rev/branch`, we keep the name of the current branch we're using.\n\nFinally, when we construct a `Directory` from the current directory, often we\ndon't care about many files, so we have an ignore list in `.rev/ignores` which\nconfigures which paths we ignore.\n\n## Contributing\n\nThere are a number of issues on the GitHub repository, please feel free to take\nany and do them.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamuelschlesinger%2Fversion-control","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamuelschlesinger%2Fversion-control","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamuelschlesinger%2Fversion-control/lists"}