HelloZeroNet / HelloZeroNet/ZeroNet

Use DAG for version control

Ouverte
#1,284 12 commentaires 3 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
JavaScript
Étoiles
18.8k
Forks
2.3k
Métriques de merge des PR
Aucune PR mergée en 30 j

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)

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
git
Domaine
tooling
Type d'issue
Fonctionnalité
Difficulté
5/5
Temps estimé
Plus d'une semaine
Activité
À l'abandon
Clarté
À clarifier
Accessibilité débutants
20/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.