Skip to content

Worktrees implementation#691

Closed
rmedaer wants to merge 6 commits into
libgit2:masterfrom
rmedaer:features/worktrees
Closed

Worktrees implementation#691
rmedaer wants to merge 6 commits into
libgit2:masterfrom
rmedaer:features/worktrees

Conversation

@rmedaer
Copy link
Copy Markdown
Contributor

@rmedaer rmedaer commented Feb 27, 2017

I started to implement Python binding for worktrees management.

Added the following features:

  • Add a new worktree: Repository#add_worktree(name, path) -> None
  • List existing worktrees: Repository#list_worktrees() -> [string]

Raphael Medaer (Escaux) added 2 commits February 27, 2017 15:28
Basic Python binding to:
  - Add a new worktree (Repository#add_worktree(name, path) --> None)
  - List existing worktrees (Repository#list_worktrees() --> [string]
@jdavid
Copy link
Copy Markdown
Member

jdavid commented Feb 27, 2017

Hi @rmedaer
Merging will have to wait for a release of libgit2 with git_worktree_*
Could you add some unit tests?

@rmedaer
Copy link
Copy Markdown
Contributor Author

rmedaer commented Feb 27, 2017

@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.
Of course, once it's implemented I can add some unit tests ! ;-)

Raphael Medaer (Escaux) added 4 commits February 27, 2017 17:06
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
@pks-t
Copy link
Copy Markdown
Member

pks-t commented Feb 28, 2017

@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

@rmedaer
Copy link
Copy Markdown
Contributor Author

rmedaer commented Feb 28, 2017

[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:

  • unlink gitlink_path directory
  • unlink gitdir_path directory
  • remove refs/heads/<worktree>

@jdavid jdavid added this to the 0.26.0 milestone Mar 30, 2017
@jdavid
Copy link
Copy Markdown
Member

jdavid commented Jul 6, 2017

Hi @rmedaer
There are conflicts merging this, could you please rebase?
Thanks!

@nhynes nhynes mentioned this pull request Jul 28, 2017
@jdavid
Copy link
Copy Markdown
Member

jdavid commented Jan 14, 2018

This was superseded by #719

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants