GitoxideLabs / gitoxide

An idiomatic, lean, fast & safe pure Rust implementation of Git
Apache License 2.0
8.91k stars 303 forks source link

Fallback to git commands? #1463

Closed crabdancing closed 2 months ago

crabdancing commented 2 months ago

Summary 💡

A built-in wrapping function to fallback to git commands when gix has no implementation

Motivation 🔦

It should make it easier to use gix as something of a drop-in replacement for git -- perhaps even aliasing git to gix.

It would be possible to do externally as a separate command, but there would be more points of failure as it would have to parse the gix output to determine that it had no command -- or worse, it'd have to hardcode which commands gix has and do some amount of parsing itself.

Byron commented 2 months ago

Thanks for sharing this idea!

However, gix is quite explicitly a development tool, whose anti-goal is to ever be a git stand-in, even without aspiration to ever be stable. Instead, ein is what should strive for providing a workflow for Git repositories.

Since gix just calls into gitoxide-core, it would be possible for anyone to leverage it to implement a git stand-in, in fact, using gix (the crate), it should be possible to one day accomplish this feat. For now, there isn't enough functionality to do that effectively though.

crabdancing commented 2 months ago

Fair enough. I notice a lot of git is single-threaded, and it quite painful (e.g. merging large repos like nixpkgs). :P

Someday I hope to replace git merge with something more concurrent on my setup.

Byron commented 2 months ago

Having not implemented merging yet, I am not quite sure how multi-threaded it can be. In theory, each sub-tree can be merged on a core and maybe that should be the concurrency model to really make a difference. However, I guess the first version will also be single-threaded, but thanks to Rust multi-threading is something that can reasonably happen as a follow-up.