[PR #63] [MERGED] Feat/migrate from libgit2 #236

Closed
opened 2026-03-02 04:13:02 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/git-ai-project/git-ai/pull/63
Author: @svarlamov
Created: 10/3/2025
Status: Merged
Merged: 10/3/2025
Merged by: @svarlamov

Base: mainHead: feat/migrate-from-libgit2


📝 Commits (7)

  • 67b8e6b start libgit2->git cli migration
  • 541fd35 use libgit2 in blame and rebase for testing
  • 96f17bc fix git path abs dir
  • d9a6171 fix get blob fn
  • b6252b2 fix flaky tests, fix get_path git fn
  • a32b60f fmt and fix global args for hooks
  • 4f12075 cleanup global args todos

📊 Changes

17 files changed (+1289 additions, -586 deletions)

View changed files

src/commands/benchmark.rs (+0 -218)
📝 src/commands/blame.rs (+17 -11)
📝 src/commands/checkpoint.rs (+14 -12)
📝 src/commands/commit_hooks.rs (+15 -56)
📝 src/commands/fetch_hooks.rs (+21 -41)
📝 src/commands/git_ai_handlers.rs (+8 -20)
📝 src/commands/mod.rs (+0 -1)
📝 src/commands/push_hooks.rs (+19 -39)
📝 src/commands/rebase_authorship.rs (+62 -43)
📝 src/commands/stats_delta.rs (+3 -2)
📝 src/error.rs (+10 -3)
📝 src/git/post_commit.rs (+25 -32)
📝 src/git/pre_commit.rs (+3 -3)
📝 src/git/refs.rs (+22 -18)
📝 src/git/repository.rs (+987 -13)
📝 src/git/status.rs (+7 -4)
📝 src/git/test_utils/mod.rs (+76 -70)

📄 Description

Sweeping refactor to use the system's git CLI instead of libgit2 for better performance and compatibility.

Replace in blame

  • Re-implement a compatible version of git2's blame_file

Replace in rebase

  • Re-implement a compatible version of git2's diff_tree_to_tree

The above todos could/should be forked out into other issues/PRs. This PR is passing tests and ready to merge without these.

Note, we'll leave libgit2 in the test_utils for now, so that we don't impact the test suite (prove we can do the same thing with the new approach). Once we have confidence in the implementation, we can update the test utils later on.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/git-ai-project/git-ai/pull/63 **Author:** [@svarlamov](https://github.com/svarlamov) **Created:** 10/3/2025 **Status:** ✅ Merged **Merged:** 10/3/2025 **Merged by:** [@svarlamov](https://github.com/svarlamov) **Base:** `main` ← **Head:** `feat/migrate-from-libgit2` --- ### 📝 Commits (7) - [`67b8e6b`](https://github.com/git-ai-project/git-ai/commit/67b8e6bdc9453f46062f9735c8f6cd0a3eccb720) start libgit2->git cli migration - [`541fd35`](https://github.com/git-ai-project/git-ai/commit/541fd3585c32e8aeef2ea899617352e77c32adef) use libgit2 in blame and rebase for testing - [`96f17bc`](https://github.com/git-ai-project/git-ai/commit/96f17bcfbf7077e1e593ec734169fba0fd7d852e) fix git path abs dir - [`d9a6171`](https://github.com/git-ai-project/git-ai/commit/d9a61713a36332105412eff8cff25e8a943a6982) fix get blob fn - [`b6252b2`](https://github.com/git-ai-project/git-ai/commit/b6252b24eb3b7a9a5b06e92d77d7ee21c1a36bfe) fix flaky tests, fix get_path git fn - [`a32b60f`](https://github.com/git-ai-project/git-ai/commit/a32b60f93cf0c10387401f27bc176c441305df3e) fmt and fix global args for hooks - [`4f12075`](https://github.com/git-ai-project/git-ai/commit/4f1207512b8cce433d729a9e3f5abd73f18aaffd) cleanup global args todos ### 📊 Changes **17 files changed** (+1289 additions, -586 deletions) <details> <summary>View changed files</summary> ➖ `src/commands/benchmark.rs` (+0 -218) 📝 `src/commands/blame.rs` (+17 -11) 📝 `src/commands/checkpoint.rs` (+14 -12) 📝 `src/commands/commit_hooks.rs` (+15 -56) 📝 `src/commands/fetch_hooks.rs` (+21 -41) 📝 `src/commands/git_ai_handlers.rs` (+8 -20) 📝 `src/commands/mod.rs` (+0 -1) 📝 `src/commands/push_hooks.rs` (+19 -39) 📝 `src/commands/rebase_authorship.rs` (+62 -43) 📝 `src/commands/stats_delta.rs` (+3 -2) 📝 `src/error.rs` (+10 -3) 📝 `src/git/post_commit.rs` (+25 -32) 📝 `src/git/pre_commit.rs` (+3 -3) 📝 `src/git/refs.rs` (+22 -18) 📝 `src/git/repository.rs` (+987 -13) 📝 `src/git/status.rs` (+7 -4) 📝 `src/git/test_utils/mod.rs` (+76 -70) </details> ### 📄 Description Sweeping refactor to use the system's git CLI instead of libgit2 for better performance and compatibility. **Replace in blame** - [ ] Re-implement a compatible version of git2's `blame_file` **Replace in rebase** - [ ] Re-implement a compatible version of git2's `diff_tree_to_tree` The above todos could/should be forked out into other issues/PRs. This PR is passing tests and ready to merge without these. Note, we'll leave libgit2 in the test_utils for now, so that we don't impact the test suite (prove we can do the same thing with the new approach). Once we have confidence in the implementation, we can update the test utils later on. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-02 04:13:02 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/git-ai#236
No description provided.