Skip to content
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

Frontend API for fetch, clone, merge, pull, push. #80

Open
TravisWhitaker opened this issue Jun 29, 2018 · 3 comments
Open

Frontend API for fetch, clone, merge, pull, push. #80

TravisWhitaker opened this issue Jun 29, 2018 · 3 comments

Comments

@TravisWhitaker
Copy link
Contributor

Hi John, thanks for your work on these packages!

I'm curious if you have any thoughts on what higher-level APIs for fetch, clone, merge, pull, and push operations might look like. As it stands, it looks like there's a bit of inconsistency among the backends with respect to how these operations are performed. As far as I can tell, this is how these operations are supported currently:

  • Fetch: Provided by Git.Libgit2.lgRemoteFetch. It looks like MonadGit used to have a remoteFetch method.
  • Clone: Provided by lgRemoteFetch followed by Git.Working.checkoutFiles. However, Bindings.Libgit2.Clone is also provided; it's not clear what advantages using libgit2's convenience function for this might be.
  • Merge: At a low level, the caller can implement whatever "merge" strategy they want by directly manipulating blobs and trees, and creating a commit with multiple parents. However, it would be useful to provide an API for writing conflicts to the index for compatibility with the git command line tool. It doesn't look like the readIndex or writeIndex methods are implemented anywhere. libgit2 provides a handy set of merge utility functions that'd be useful in the frontend API as well.
  • Pull: Provided by lgRemoteFetch plus merging at a low-level with blobs and trees.
  • Push: We have Git.Commit.Push.pushCommit, but something in Git.Libgit2 that takes advantage of libgit2's (likely more efficient?) push functionality would be handy.

Am I missing anything obvious/more convenient here?

A potential issue with introducing a frontend API for these operations is the difference in functionality among existing and future backends. Perhaps MonadGit could be broken into smaller classes, allowing backends to implement specific subsets of the frontend API capabilities.

@jwiegley
Copy link
Owner

Some nice ideas, and I don't see that you've missed much. Do you want to take over maintenance of gitlib-libgit2 perhaps?

@TravisWhitaker
Copy link
Contributor Author

I'll take a crack at these as time allows, and if you're looking for a (co-)maintainer I'd be happy to help.

@jwiegley
Copy link
Owner

jwiegley commented Jul 3, 2018

@TravisWhitaker Yes, someone to help move things forward would be fantastic. I haven't had much time for gitlib lately, but I'd be more than happy to assist.

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

No branches or pull requests

2 participants