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

Move git deps to optional in CLI #257

Merged
merged 2 commits into from
Jan 3, 2024
Merged

Conversation

Virviil
Copy link
Contributor

@Virviil Virviil commented Dec 27, 2023

Dependency Update and Installation Enhancement

Changes

  • Removed mandatory dependency on git2 in the CLI, since 99% of programmers already have Git installed as CLI.
  • Added optional dependency on git2 and gix
  • Added the ability to choose an alternative Git via the --feature flag.
    • git2: binds to libgit.
    • gix: fully native Git written in Rust.

Explanations

This change improves the installation process by removing the mandatory dependency on git2 and giving users the option to choose between two Git alternatives.
This can be crucial because of some issues with git2 (rust-lang/git2-rs#672).
Now, if the user already has Git installed, the installation process will proceed more smoothly.

Additional Changes

  • Excluded Cargo.lock from the repository as it is not used during installation via cargo install.

@kaplanelad
Copy link
Contributor

hey, can you explain more how it improve the installation?

the default clone is based in the local git and the fallback is automatically happen to the lib.

@Virviil
Copy link
Contributor Author

Virviil commented Dec 27, 2023

@kaplanelad It improves the installation of a CLI itself.

cargo install loco-cli is failing for me (hope that not only for me) because of rust-lang/git2-rs#672. git2 is mandatory, while being a fallback (as you say).

Fallback is very hardly used, because developers using loco for sure (like 99%, because they are developers) have git installed.

So, this change move this dep into optional + add the posibility to choose NOT git2 (which is not linking), but gitoxide, which is native rust git implementation.

1% of developers that dont have git but know what they are doing can intall cli with

cargo install loco-cli -F git2

@Virviil
Copy link
Contributor Author

Virviil commented Jan 3, 2024

@kaplanelad @jondot any updates, suggestions?

@kaplanelad kaplanelad merged commit 992cfe9 into loco-rs:master Jan 3, 2024
10 checks passed
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