gitoxide icon indicating copy to clipboard operation
gitoxide copied to clipboard

Add a user-friendly way to build trees

Open Jake-Shadle opened this issue 1 year ago • 1 comments

Summary 💡

A simple API to manipulate trees more akin to a filesystem would be more intuitive for most common uses of mutable trees.

Motivation 🔦

Currently building trees is fairly manual since Tree is only a single level, as well as having other restrictions

The directories and files contained in this tree. They must be and remain sorted by filename

This feature is available in git2 as TreeUpdateBuilder

Jake-Shadle avatar Jul 06 '23 09:07 Jake-Shadle

I'd definitely want to have something like TreeUpdateBuilder at some point as well, if only for completeness. I am saying this as I think that an index.to_tree() may happen before this issue is tackled as git add and friends will work with an index. Using an index has further advantages as it can re-use trees that haven't changed thanks to its TREE extension Of course, if every tree is fully generated, or they are small enough, there probably wouldn't be much of a benefit.

In any case, I will keep it in mind and see that I can make it happen maybe even before the cargo integration is done (cargo doesn't seem to be building trees (yet)).

Byron avatar Jul 06 '23 10:07 Byron