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

Allow to use with Git CLI #146

Open
pascalberger opened this issue Jun 21, 2021 · 3 comments
Open

Allow to use with Git CLI #146

pascalberger opened this issue Jun 21, 2021 · 3 comments

Comments

@pascalberger
Copy link
Member

Using LibGit2Sharp has some limitations and can lead to runtime errors. In some cases Git CLI is available and could be used to achieve the task. We could add a global switch to the addin to define if the addin should run in LibGit2Sharp or Git CLI mode and then have separate implementation for every alias (one with LibGit2Sharp, another with Git CLI).

Ideally it would not load LibGit2Sharp when used in Git CLI mode, but this would require a bigger refactoring and have LibGit2Sharp manually loaded at runtime.

@devlead
Copy link
Member

devlead commented Jun 21, 2021

Seems like a separate addin to me, there's some fundamental differences between libgit and git cli scripts.

Essentially an fairly complete libgit to cli abstraction would need to be created.

@pascalberger
Copy link
Member Author

The downside of having it in a separate addin is that recipe scripts (like e.g. Cake.Issues.Recipe or Cake.Recipe) would need to implement the abstraction themselves if they want to have support for both, except a third addin which implements the abstraction is created, but this sound quite complicated to maintain, keep up to date and compatible. The advantage of separate addins would be that we can get rid of LibGit2Sharp completely (but this won't help if both addins were used together in a recipe script).

@devlead
Copy link
Member

devlead commented Jun 21, 2021

One way to solve not even loading libgit could be to move current Cake.Git libgit implementation out of process too, and have a common cli protocol. between the different git provider wrappers in Cake.Git. Would add complexity though, and likely a noticeable performance hit, especially since there's not a 1:1 mapping between git cli scripts and libgit library.
If all logic would be in Cake.Git would mean maintaining a multiple set of implementations for each alias, having one to one many commands emulate the other one.

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

No branches or pull requests

3 participants