You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now we have ported the `radicle-surf` crate from its own github repo to be part of the `radicle-git` repo. We are taking this opportunity to refactor its design as well. Intuitively, `radicle-surf` provides an API so that one can use it to create a github-like UI for a git repo:
4
+
5
+
- Given a commit (or other types of ref), list the content: i.e. files and directories.
6
+
- Generate a diff between two commits.
7
+
- List the history of the commits.
8
+
- List refs: Branches, Tags.
9
+
10
+
The main goals of the changes are:
11
+
12
+
- make API simpler whenever possible.
13
+
- address open issues in the original `radicle-surf` repo as much as possible.
14
+
- not to shy away from being `git` specific. (i.e. not to consider supporting other VCS systems)
15
+
16
+
## Make API simpler
17
+
18
+
The current API has quite a bit accidental complexity that is not inherent with the requirements, especially when we can be git specific and don't care about other VCS systems.
19
+
20
+
### Remove the `Browser`
21
+
22
+
The type `Browser` is awkward as of today:
23
+
24
+
- it is not a source of truth of any information. For example, `list_branches` method is just a wrapper of `Repository::list_branches`.
25
+
- it takes in `History`, but really works at the `Snapshot` level.
26
+
- it is mutable but its state does not help much.
27
+
28
+
Can we just remove `Browser` and implement its functionalities using other types?
29
+
30
+
- For iteratoring the history, use `History`.
31
+
- For generating `Directory`, use `Repository` directly given a `Rev`.
32
+
- For accessing `Branch`, `Tag` or `Commit`, use `Repository`.
33
+
34
+
## Remove the `Snapshot`
35
+
36
+
A `Snapshot` should be really just a tree (or `Directory`) of a `Commit` in git. Currently it is a function that returns a `Directory`. Because it is OK to be git specific, we don't need to have this generic function to create a snapshot across different VCS systems.
0 commit comments