From 1838e25d2f857f88f1487dc9c7029bf55a41e424 Mon Sep 17 00:00:00 2001 From: 0x61nas Date: Wed, 8 Oct 2025 20:48:25 +0300 Subject: [PATCH] feat(cargo): add vendored-libgit2 feature (#3426) * feat(cargo): add vendored-libgit2 feature this is done to resolve the issues when the host system doesn't have `libgit2` installed or if its incompatible with the version we expect see: sharkdp/bat/issues/2939 * docs(changelog): add vendored libgit2 entry --- CHANGELOG.md | 1 + Cargo.toml | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 23109dba..d2c6d0fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,7 @@ - Update console dependency to 0.16, see #3351 (@musicinmybrain) - Fixed some typos #3244 (@ssbarnea) - Update onig_sys dependency to 69.9.1 to fix a gcc build failure #3400 (@CosmicHorrorDev) +- Add a cargo feature (`vendored-libgit2`) to build with vendored libgit2 version without depending on the system's one #3426 (@0x61nas) ## Syntaxes diff --git a/Cargo.toml b/Cargo.toml index 85d97474..5759dc2e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,13 +14,12 @@ edition = '2021' rust-version = "1.74" [features] -default = ["application"] +default = ["application", "git"] # Feature required for bat the application. Should be disabled when depending on # bat as a library. application = [ "bugreport", "build-assets", - "git", "minimal-application", ] # Mainly for developers that want to iterate quickly @@ -33,6 +32,7 @@ minimal-application = [ "wild", ] git = ["git2"] # Support indicating git modifications +vendored-libgit2 = ["git2/vendored-libgit2"] paging = [ "shell-words", "grep-cli", "minus"] # Support applying a pager on the output lessopen = ["execute"] # Support $LESSOPEN preprocessor build-assets = ["syntect/yaml-load", "syntect/plist-load", "regex", "walkdir"]