HelloZeroNet / HelloZeroNet/ZeroNet

Use DAG for version control

Đang mở
#1,284 12 bình luận 3 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
JavaScript
Star
18.8k
Fork
2.3k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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)

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Hướng nghiên cứu

Không có tệp mã nguồn, entry point hoặc test nào được nêu. Hãy bắt đầu bằng cách đọc các ví dụ DAG và các tham chiếu Git được liên kết, sau đó xác định cách ZeroNet xử lý manifest và phiên bản tệp. Làm rõ cách các thao tác chỉnh sửa, xóa, mũi tên, đặt tên tệp, giới hạn kích thước và duyệt lịch sử cần hoạt động; công việc được xem là hoàn tất khi có thiết kế đã thống nhất và các test cho những trường hợp đó.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
git
Lĩnh vực
tooling
Loại issue
Tính năng
Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
20/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.