HelloZeroNet / HelloZeroNet/ZeroNet
Use DAG for version control
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 18.8k
- Forks
- 2.3k
- PR merge metrics
- No merged PRs in 30d
Description
Hey, ZeroNet dev!
Doing version control? Consider the following _Directed Acyclic Graph_.
```
(3) (4)
↙ ↙
(0) ← (1) ← (2) ← (5)
```
Suppose these are your ZeroMe posts. Each file contains several posts. Each file is a _vertex_. You started with file `(0)`. You wrote a lot and file `(0)` exploded. You decided to make a new file `(1)` and continue writing. Weeks later, file `(1)` became full and you made another new file `(2)`.
Then you decided to edit one of your old posts and expand it a little bit. It is contained in file `(0)`. Unfortunately, your edit cannot be saved in file `(0)` because the file hit its size limit. Using a DAG, what you need to do is to
a) make a new file `(3)` and put your edited post there;
b) delete the old post from file `(0)`;
c) draw an arrow from file `(3)` to file `(0)`.
Each _vertex_ has multiple arrows going in (_in degree_), but only 1 arrow going out (_out degree_).
The earliest file is a _sink_, it has no "out" arrow. Newer files point to older files, letting you to go back in time.
You may ask, "what about file name conflict?" Short answer: This is how file systems work. To keep multiple versions of the same file, all you need to do is to name them properly.
```
fsfs-1.pdf Free Software, Free Society (first edition)
fsfs-2.pdf Free Software, Free Society (second edition)
fsfs-3.pdf Free Software, Free Society (third edition)
```
Good luck hacking DAGs and keeping manifest files small!
References:
[Git for Computer Scientists](http://eagain.net/articles/git-for-computer-scientists/)
[Git - Basic Branching and Merging](https://git-scm.com/book/en/v2/Git-Branching-Basic-Branching-and-Merging)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No source file, entry point, or test is named. Start by reading the DAG examples and the linked Git references, then locate ZeroNet’s manifest and file-version handling. Clarify how edits, deletion, arrows, file naming, size limits, and history traversal should work; done requires an agreed design and tests for those cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100