Skip to content

Release/v0.4.2#35

Merged
tamada merged 10 commits into
mainfrom
release/v0.4.2
Jan 11, 2026
Merged

Release/v0.4.2#35
tamada merged 10 commits into
mainfrom
release/v0.4.2

Conversation

@tamada

@tamada tamada commented Dec 31, 2025

Copy link
Copy Markdown
Owner

introduce features uselibgit, usegix, and default for selecting the git operation.

  • uselibgit uses git2,
  • usegix uses gix, and
  • default uses system git command.

@tamada tamada added this to the v1.0.0 milestone Dec 31, 2025
@tamada
tamada requested a review from Copilot December 31, 2025 06:06
@tamada tamada self-assigned this Dec 31, 2025

Copilot AI 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.

Pull request overview

This PR introduces a feature flag system to select between three Git operation backends for managing boilerplate repositories: uselibgit (using git2/libgit2), usegix (using the pure Rust gix crate), and default (using system git commands). This provides flexibility in choosing the Git backend based on deployment requirements and dependencies.

Key Changes:

  • Introduced feature flags in Cargo.toml for selecting Git backends
  • Refactored Repository and Boilerplate into a new repos module
  • Created a gitbridge abstraction layer with three backend implementations
  • Changed GixorError::Git from wrapping git2::Error to using String for backend-agnostic error handling

Reviewed changes

Copilot reviewed 17 out of 18 changed files in this pull request and generated 13 comments.

Show a summary per file
File Description
lib/src/repos.rs New module containing Repository and Boilerplate structs extracted from lib.rs
lib/src/gitbridge.rs New abstraction layer for Git operations with feature-flag based backend selection
lib/src/gitbridge/systemgit.rs New implementation using system git commands (default backend)
lib/src/gitbridge/gix.rs New implementation using pure Rust gix crate
lib/src/gitbridge/git2.rs Refactored git2 implementation from lib/src/git.rs
lib/src/lib.rs Refactored to use new modules and feature documentation added
lib/src/routine.rs Updated to use new module paths and error handling
lib/src/utils.rs Removed (utilities moved to GixorError methods)
lib/Cargo.toml Added feature flags and made git dependencies optional
cli/Cargo.toml Configured to use usegix feature and updated reqwest
cli/src/main.rs Updated imports to use repos module
Version files Updated version from 0.4.1 to 0.4.2
Cargo.lock Regenerated for new dependencies
Comments suppressed due to low confidence (6)

lib/src/gitbridge/git2.rs:4

  • Typo in documentation: "sed" should be "used".
    lib/src/gitbridge/git2.rs:5
  • Grammar issue in documentation: "is requires" should be "requires".
    lib/src/gitbridge/git2.rs:7
  • Trailing whitespace at the end of this line. Consider removing it for code style consistency.
    lib/src/gitbridge/git2.rs:11
  • Trailing whitespace at the end of this line. Consider removing it for code style consistency.
    lib/src/gitbridge/git2.rs:10
  • Trailing whitespace at the end of this line. Consider removing it for code style consistency.
    lib/src/gitbridge/git2.rs:12
  • Trailing whitespace at the end of this line. Consider removing it for code style consistency.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/src/repos.rs Outdated
Comment thread lib/src/gitbridge/gix.rs Outdated
Comment thread lib/src/lib.rs Outdated
Comment thread lib/src/repos.rs Outdated
Comment thread lib/src/gitbridge/systemgit.rs Outdated
let base_path = base_path.as_ref();
log::info!("hash(base_path: {:?}, target: {:?})", base_path, boilerplate.path());
let r = Command::new("git")
.args(["log", "--format=%H", "-n", "1", boilerplate.path().to_str().unwrap()])

Copilot AI Dec 31, 2025

Copy link

Choose a reason for hiding this comment

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

Potential panic: calling unwrap() on boilerplate.path().to_str(). If the path contains invalid UTF-8, this will panic. Consider using to_string_lossy() or returning an appropriate error.

Copilot uses AI. Check for mistakes.
Comment thread lib/src/gitbridge/gix.rs Outdated
Comment thread lib/src/lib.rs Outdated
Comment thread lib/src/repos.rs Outdated
Comment thread lib/src/repos.rs Outdated
Comment thread lib/src/lib.rs Outdated
@coveralls

Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 20874504191

Details

  • 301 of 415 (72.53%) changed or added relevant lines in 7 files are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+5.5%) to 60.355%

Changes Missing Coverage Covered Lines Changed/Added Lines %
lib/src/aliases.rs 6 7 85.71%
lib/src/routine.rs 14 20 70.0%
lib/src/gitbridge/systemgit.rs 41 53 77.36%
cli/src/main.rs 0 15 0.0%
lib/src/lib.rs 48 72 66.67%
lib/src/repos.rs 183 239 76.57%
Files with Coverage Reduction New Missed Lines %
lib/src/lib.rs 2 68.66%
Totals Coverage Status
Change from base Build 19093496840: 5.5%
Covered Lines: 781
Relevant Lines: 1294

💛 - Coveralls

@tamada
tamada merged commit 7377f4f into main Jan 11, 2026
3 checks passed
@tamada
tamada deleted the release/v0.4.2 branch January 13, 2026 04:33
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.

4 participants