Closed keepsimple1 closed 1 year ago
I might also point out that the current Tree
and Blob
types would not be needed if we deprecate and remove them due to https://github.com/radicle-dev/heartwood/issues/172
I personally don't find it confusing, and think it might be a good idea to have both. If we should only have one type, then I'd opt for Blob/Tree
, since the path is known by the user.
I think the confusion stems from the two pairs of types being similar but having different expectations on the user end, i.e. Tree
and Blob
were there for serialization purposes which we're deeming as not needed in this discussion https://github.com/radicle-dev/heartwood/issues/172
I don't really understand how this is related to serialization. To me it's just a matter of whether we need a wrapper type around blob/tree. We have Blob { data: Vec<u8>, oid: Oid }
conceptually, which is one of the basic git object types, and then the question is if we also want to have File { path: PathBuf, blob: Blob, mode: FileMode }
for example.
I also don't think serialization is a major factor. It seems that our users (currently radicle-httpd
) are comfortable with using Tree
and Blob
.
To me it's just a matter of whether we need a wrapper type around blob/tree.
Sounds good to me. I think we don't need to consolidate them. For Directory
and File
, we can keep them and their API would be clearer once people start to utilize them.
It was related to serialization because that was the marked difference between the two types, originally. Tree
existed to be Serialize
for the http-api
/Upstream
code, similarly for Blob
:) But it seems like we've come to a good conclusion :+1:
Sounds good to me. I think we don't need to consolidate them. For Directory and File, we can keep them and their API would be clearer once people start to utilize them.
I'll close this issue then :)
Currently (and with this pending PR)
radicle-surf
has two sets of types that are related, different while partially overlapping:Directory
andFile
: represent a directory and a file in the file system of a particular commit.Tree
andBlob
: represent a git tree object and a git blob object.A
Tree
represents the content of aDirectory
, and aBlob
represents the content of aFile
. Multiple directories can point to the same tree and multiple files can point to the same blob.Because our users often are interested in the contents of a directory or a file, they could use either
Directory
,File
types orTree
,Blob
types to retrieve the info. In such cases, these two pairs seem to be overlapping and might cause confusions. Naturally we ask this question: should we consolidate them into only one pair of types? This issue is opened to track this question.