{"id":28393541,"url":"https://github.com/pistondevelopers/history_tree","last_synced_at":"2026-03-08T08:34:20.758Z","repository":{"id":57655950,"uuid":"81840193","full_name":"PistonDevelopers/history_tree","owner":"PistonDevelopers","description":"A persistent history tree for undo/redo","archived":false,"fork":false,"pushed_at":"2021-04-11T09:56:34.000Z","size":5,"stargazers_count":24,"open_issues_count":0,"forks_count":3,"subscribers_count":48,"default_branch":"master","last_synced_at":"2025-07-10T19:44:43.798Z","etag":null,"topics":["algorithm","rust","undo-redo"],"latest_commit_sha":null,"homepage":null,"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/PistonDevelopers.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"bvssvni"}},"created_at":"2017-02-13T15:31:24.000Z","updated_at":"2024-04-10T11:28:22.000Z","dependencies_parsed_at":"2022-08-25T08:02:09.287Z","dependency_job_id":null,"html_url":"https://github.com/PistonDevelopers/history_tree","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/PistonDevelopers/history_tree","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PistonDevelopers%2Fhistory_tree","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PistonDevelopers%2Fhistory_tree/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PistonDevelopers%2Fhistory_tree/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PistonDevelopers%2Fhistory_tree/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PistonDevelopers","download_url":"https://codeload.github.com/PistonDevelopers/history_tree/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PistonDevelopers%2Fhistory_tree/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267610419,"owners_count":24115435,"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","status":"online","status_checked_at":"2025-07-28T02:00:09.689Z","response_time":68,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["algorithm","rust","undo-redo"],"created_at":"2025-05-31T16:38:38.833Z","updated_at":"2026-03-08T08:34:20.731Z","avatar_url":"https://github.com/PistonDevelopers.png","language":"Rust","funding_links":["https://github.com/sponsors/bvssvni"],"categories":[],"sub_categories":[],"readme":"# history_tree\nA persistent history tree for undo/redo\n\nThis data structure makes programming of editors easier when the editor environment\nis open ended, such as editors that are hosting other editors.\nIt makes it possible to create game engines where scripted components\nare interdependent and basis for new editor functionality.\n\nA persistent data structure is one that stores immutable data efficiently.\nThis allows a programming pattern that does not rely on undoing\nand redoing by mutating a data structure.\nInstead, you store data in blocks that is referenced by index in the history tree.\n\nThe relations between the blocks is controlled by reading out child relations.\nData blocks can reference earlier data blocks safely.\nThe history tree does not need to know how these references are represented,\nbecause the consistency is guaranteed by replicating the same state of earlier trees.\n\nThis history tree stores records that points to previous version and parent.\nThe tree is a function of these records plus a cursor.\nThe cursor determine which records are active.\n\nWhen a record is pointed to by a new active record, it gets overriden.\nA record is considered child of a parent when it points to the parent or any previous version.\n\n`.add`/`.change`/`.delete` are `O(1)` operations.\n\n`.children` is `O(N * M)` operation where `N` is number of parent versions and `M` is records.\n\nTo make `.children` fast, records are stored with only indices.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpistondevelopers%2Fhistory_tree","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpistondevelopers%2Fhistory_tree","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpistondevelopers%2Fhistory_tree/lists"}