-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add git status
functionality
#309
Comments
Design DocGoalOur goal is to have
Information to surface
How to surfaceAs a tree?One particularly neat way to surface this information would be to show the hierarchy as tree. We could construct a tree for the snapshot + changeset: As plain text?We could simply output formatted lists of created/updated/deleted groups/arrays. MiscSome things to be careful about:
|
I'll add another option to "How to surface":
That could help us in the future have an answer to 3. Example: struct Status(Vec<(Path, Vec[Change])>)
enum Change {
ArrayCreated(ZarrMetadata),
ArrayMetadataUpdated(ZarrMetadata),
ChunksDeleted(Vec<ChunkIndices>),
ChunksWritten(Vec<ChunkIndices>),
GroupDeleted,
....
} This would give us a high level language. Then we can build different types of formaters on top of it. |
@dcherian I realize my proposal is very similar to work I'll have to do for transaction log support. That structured status looks a lot like a transaction log. Maybe we shouldn't try to do both things in parallel, but we can discuss more. |
Ah nice, yes that makes sense. I'm also thinking the formatting of the structure should live in Rust, and we may want to expose it through a CLI in the future? |
We should probably design both status and transaction log as abstract data structures and then build ways to transform them into something for display in different contexts, e.g.
|
I was about to raise an issue asking for a way to do a "
I also think this would be useful. |
|
A diff between the current state and the last commit would also be very useful in the short term, and presumably doesn't require going back through and summarizing the whole transaction log. |
Every commit generates a Transaction Log. it should be quite easy to convert a Transaction Log (or a merge of many transaction logs) into a textual description. Tx logs are a pretty simple datastructure: pub struct TransactionLog {
pub new_groups: HashSet<NodeId>,
pub new_arrays: HashSet<NodeId>,
pub deleted_groups: HashSet<NodeId>,
pub deleted_arrays: HashSet<NodeId>,
pub updated_user_attributes: HashSet<NodeId>,
pub updated_zarr_metadata: HashSet<NodeId>,
pub updated_chunks: HashMap<NodeId, HashSet<ChunkIndices>>,
} We introduced Tx logs for two reasons: diffs, and rebases. |
@paraseba how hard would it be for me to add this feature now? I just want to be able to run something from the command line that prints some textual representation of the diff. |
@TomNicholas I don't think it would be hard, have you done any Rust? I can be your guide through the Rust code. Worst case scenario, we could expose the |
I have not, but this seems like a good opportunity to learn.
❤ I'll raise a separate issue for this now, as it seems like a smaller feature than described by this issue. |
No description provided.
The text was updated successfully, but these errors were encountered: