Skip to content

feat(git): replace usage of git2 with gix#192

Closed
mkatychev wants to merge 3 commits into
coralogix:masterfrom
mkatychev:feat/gix
Closed

feat(git): replace usage of git2 with gix#192
mkatychev wants to merge 3 commits into
coralogix:masterfrom
mkatychev:feat/gix

Conversation

@mkatychev

@mkatychev mkatychev commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

There are currently no plans for git2 to support newer git APIs so any credential helper resolvers that involve nested git configs will not be possible using git2 (my case below):

[includeIf "gitdir:~/work/**"]
  path = ~/work/.gitconfig

Implemented git resolution with gix and the gix_credential_resolver to handle cascading configuration resolutions.

@mkatychev mkatychev requested a review from a team as a code owner April 7, 2026 18:50
Comment thread src/git/repository.rs
let blob = self
.git_repo
.find_object(entry.oid())
.map_err(|e| ProtoRepoError::GitError(Box::new(e)))?;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happy to add From<E> for ProtofetchError impls but I'm waiting to see if there is appetite for this PR to move forward first.

This swap to gix solved most of my private https depencency problems hence the pull request.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rtimush I am happy to put this back into draft for more feedback, I am leaving open for now just to signal that this swap does work.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: db20c4d236

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/git/repository.rs
Comment thread src/git/repository.rs
Comment thread src/git/cache.rs
Comment on lines -156 to -161
if allowed_types.contains(CredentialType::USERNAME) && !tried_username {
tried_username = true;
return Cred::username("git");
}
// SSH auth
if allowed_types.contains(CredentialType::SSH_KEY) && !tried_agent {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gix also has the benefit of resolving credetial resolution for you through URL parsing and anything else git credentials does properly.

@rtimush

rtimush commented May 28, 2026

Copy link
Copy Markdown
Collaborator

Hi @mkatychev. First of all, thank you for the contribution. gix can indeed solve a lot of problems we have with git2. However, after some discussions within the team, we tend to prefer the alternative of switching to using git CLI (something similar to this draft PR). This way we can significantly reduce our dependency tree, and make sure we are fully compatible with the canonical git implementation. We may still consider having git2 and gix backends as optional features though.

@mkatychev

Copy link
Copy Markdown
Contributor Author

@rtimush thank you for taking time to do writeup. This makese sense though I suppose it's a matter of dogmatic taste but I prefer larger binaries/longer compilations over external bins/dylibs.

@mkatychev mkatychev closed this Jun 11, 2026
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.

2 participants