Worktrees implementation#691
Conversation
Basic Python binding to: - Add a new worktree (Repository#add_worktree(name, path) --> None) - List existing worktrees (Repository#list_worktrees() --> [string]
|
Hi @rmedaer |
|
@jdavid no problem, I can wait. Btw, I'm adding a new PyObject Worktree to implement all the features (prune, lock, unlock). Actually my first commit was a test. |
In this commit I added a new PyObject: Worktree. This is the binding of git_worktree from libgit2. Still have to implement prune, lock and unlock but you can at list get Worktree name and path.
Implemented Repository#lookup_worktree(name) -> Worktree
Implemented method and getter: - Worktree#prune(force=False) - Worktree#is_prunable
|
@rmedaer Are there any comments regarding the C API itself? The implementation is obviously still very new and I'd like to weed out design smells before it hits the first release |
|
[EDIT: I misunderstood your comment] I don't really have comment about it. However I was just surprised about the prune function which is not removing head ref. It might be useful to document the workflow to remove a worktree. If I well understood:
|
|
Hi @rmedaer |
|
This was superseded by #719 |
I started to implement Python binding for worktrees management.
Added the following features: