etc/speak/gitmerge-2024.marp.md
What it is, and isn't
https://github.com/Byron/gitoxide
(and wants to be)
https://github.com/Byron/gitoxide
git2 - A Rust crate :heart: binding to libgit2libgit2
libgit-rs - a Rust crate binding to libgit.athe high-performance Rust crate that acts like Git would
<!-- benefits clients, no need to re-implement stuff users expect from you --> <!-- respect configuration, but allow overrides -->the binaries gix and ein
Gitoxidea Git replica
<!-- `gix` will never be `git`, never stable, won't mimmick it --> <!-- But `gitoxide` should be versatile enough to implement the majority of Git -->always quite as easy-to-use as git2
usable from any other language but Rust
<!-- in great contrast to `git2` -->stable (yet)
jjgitoxide features suffice
gix::Repository)/**hello.*@~1refs/heads/*:refs/remotes/origin/*async-support for networked IOReal world code written by a real API user, courtesy of GitButler.
#[tauri::command(async)]
pub fn git_clone_repository(repository_url: &str, target_dir: &Path) -> Result<(), Error> {
git2::Repository::clone(repository_url, target_dir).context("Cloning failed")?;
Ok(())
}
#[tauri::command(async)]
pub fn git_clone_repository(repository_url: &str, target_dir: &Path) -> Result<(), Error> {
let url =
gix::url::parse(repository_url.into()).context("Failed to parse repository URL")?;
let should_interrupt = AtomicBool::new(false);
let mut prepared_clone =
gix::prepare_clone(url, target_dir).context("Failed to prepare clone")?;
let (mut prepared_checkout, _) = prepared_clone
.fetch_then_checkout(Discard, &should_interrupt)
.context("Failed to fetch")?;
let should_interrupt = AtomicBool::new(false);
prepared_checkout
.main_worktree(Discard, &should_interrupt)
.context("Failed to checkout main worktree")?;
Ok(())
}
#[tauri::command(async)]
pub fn git_clone_repository(repository_url: &str, target_dir: &Path) -> Result<(), Error> {
let url = gix::url::parse(repository_url.into()).map_err(anyhow::Error::from)?;
let should_interrupt = AtomicBool::new(false);
let (mut checkout, _outcome) = gix::prepare_clone(url, target_dir)
.map_err(anyhow::Error::from)?
.fetch_then_checkout(Discard, &should_interrupt)
.map_err(anyhow::Error::from)?;
checkout
.main_worktree(Discard, &should_interrupt)
.map_err(anyhow::Error::from)?;
Ok(())
}
#[tauri::command(async)]
pub fn git_clone_repository(repository_url: &str, target_dir: &Path) -> Result<(), UnmarkedError> {
let should_interrupt = AtomicBool::new(false);
gix::prepare_clone(repository_url, target_dir)?
.fetch_then_checkout(gix::progress::Discard, &should_interrupt)
.map(|(checkout, _outcome)| checkout)?
.main_worktree(gix::progress::Discard, &should_interrupt)?;
Ok(())
}
#[tauri::command(async)]
pub fn git_clone_repository(repository_url: &str, target_dir: &Path) -> Result<(), Error> {
git2::Repository::clone(repository_url, target_dir).context("Cloning failed")?;
Ok(())
}
#[tauri::command(async)]
pub fn git_clone_repository(repository_url: &str, target_dir: &Path) -> Result<(), UnmarkedError> {
let should_interrupt = AtomicBool::new(false);
gix::prepare_clone(repository_url, target_dir)?
.fetch_then_checkout(gix::progress::Discard, &should_interrupt)
.map(|(checkout, _outcome)| checkout)?
.main_worktree(gix::progress::Discard, &should_interrupt)?;
Ok(())
}