[05/08] replace mutating git action paths and network operation plumbing#99
Open
mjc wants to merge 44 commits into
Open
[05/08] replace mutating git action paths and network operation plumbing#99mjc wants to merge 44 commits into
mjc wants to merge 44 commits into
Conversation
(cherry picked from commit 122fdf1)
Wire a no-TUI entry point that loads the repo, skips workdir status to avoid case-colliding paths on case-insensitive filesystems, waits for the graph walker to finish, prints the commit count, and shuts down background tasks.
(cherry picked from commit 4b30648)
(cherry picked from commit 427dce7)
(cherry picked from commit 9854674)
(cherry picked from commit 6ce842f)
(cherry picked from commit dac26d1)
(cherry picked from commit 77e669a)
(cherry picked from commit 1484548)
There was a problem hiding this comment.
Pull request overview
This PR begins migrating mutating Git actions from libgit2 to gitoxide (gix) by introducing a shared gix “action boundary” layer and moving multiple action/query families (branching/checkout/fetch/tagging/submodules/worktrees) onto gix refs, config, index, checkout, and network/auth plumbing. It also updates core types and tests/benchmarks to support gix OIDs, gix timestamps, and the new behavior boundaries.
Changes:
- Introduces shared gix support layers (
git::actions::gix_support,git::gix) and extends auth with gix credential adapters. - Migrates key action families (branching, checkout, fetch, tagging, submodules) to gix-based ref/config/index/checkout/network operations.
- Updates core models (OIDs, worktrees, submodules, reflogs, layers) and adds/rewires extensive test coverage; adds
--exit-when-graph-completefor benchmarking/automation.
Reviewed changes
Copilot reviewed 94 out of 95 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/tests/helpers/localisation.rs | Stabilize language tests with guard + tempfile path creation |
| src/tests/helpers/keymap.rs | Add language guard to avoid cross-test localisation leakage |
| src/tests/helpers/heatmap.rs | New unit tests for gix-backed heatmap + OID prefix lookup |
| src/tests/helpers/branch_visibility.rs | Extend coverage for ref parsing + bare repo branch listing |
| src/tests/git/queries/worktrees.rs | Rework tests for new gix-backed worktree query behavior |
| src/tests/git/queries/remotes.rs | Update tests for path-based remote queries + bare repo handling |
| src/tests/git/queries/reflogs.rs | Update reflog tests for gix-backed reflog reading |
| src/tests/git/queries/files.rs | Update tests to use shared test_support helpers |
| src/tests/git/queries/file_history.rs | Expand/adjust file history tests for gix-backed status logic |
| src/tests/git/os/path.rs | Use shared TestDir helper in path tests |
| src/tests/git/auth.rs | Add tests for gix credential adapter + SSH key lookup order |
| src/tests/git/actions/worktrees.rs | Use shared TestDir in worktree action tests |
| src/tests/git/actions/tagging.rs | New tests for gix-backed lightweight tagging |
| src/tests/git/actions/reverting.rs | Refactor revert tests to shared test_support helpers |
| src/tests/git/actions/resetting.rs | New tests for reset behavior across linked worktrees |
| src/tests/git/actions/remotes.rs | Refactor remote action tests to shared temp_repo helper |
| src/tests/git/actions/rebasing.rs | Refactor rebase tests to shared test_support helpers |
| src/tests/git/actions/pushing.rs | New tests for push branch/tags and remote-branch deletion |
| src/tests/git/actions/fetching.rs | New tests for gix-backed fetch + pruning + linked worktrees |
| src/tests/git/actions/cherrypicking.rs | Refactor cherrypick tests to shared test_support helpers |
| src/tests/git/actions/checkout.rs | New tests for gix-backed checkout in linked worktrees |
| src/tests/git/actions/branching.rs | Add/expand tests for gix-backed branching + config behavior |
| src/tests/core/reflogs.rs | Switch core reflog time type expectations to gix time |
| src/tests/core/oids.rs | New unit tests for new Oids intern/prefix behavior |
| src/tests/app/state/app.rs | Add tests for wait_until_graph_complete and graph completion behavior |
| src/tests/app/input/worktrees.rs | Update worktree OID types to gix ObjectId in tests |
| src/tests/app/input/navigation.rs | Stabilize branch-toggle test against varying default branch name + language guard |
| src/tests/app/input/git.rs | Update reflog time type to gix time in tests |
| src/tests/app/input/events.rs | Update worktree/reflog OID/time test helpers to gix equivalents |
| src/tests/app/draw/worktrees.rs | Update WorktreeEntry head OID type in draw tests |
| src/tests/app/draw/status.rs | Update GraphRow defaults to match new struct fields |
| src/tests/app/draw/settings.rs | Add language guard for localisation-sensitive rendering test |
| src/tests/app/draw/search.rs | Stop using short_oid field; derive display from OID |
| src/tests/app/draw/graph.rs | Update GraphRow defaults + GraphHistory API usage in tests |
| src/main.rs | Add --exit-when-graph-complete mode and repo path parsing |
| src/lib.rs | Expose new git::gix + git::test_support modules; add gix_support |
| src/helpers/time.rs | Add gix time formatting helpers; keep git2 compatibility |
| src/helpers/heatmap.rs | Migrate heatmap counting/building to gix + add streaming HeatmapCounts |
| src/helpers/branch_visibility.rs | Use gix refs enumeration; add UTF-8-safe ref name parsing |
| src/git/test_support.rs | New shared test utilities: repo init/commit helpers, worktree fixtures, language guard |
| src/git/queries/worktrees.rs | Reimplement worktree listing/metadata using gix + add dirty-scan policy options |
| src/git/queries/remotes.rs | Reimplement remote enumeration + default remote resolution using gix config/remotes |
| src/git/queries/reflogs.rs | Reimplement HEAD reflog retrieval using gix reflog APIs |
| src/git/queries/helpers.rs | Treat submodule commit entries as Added in tree walk; simplify hunk/header construction |
| src/git/queries/files.rs | Switch tracked file enumeration to gix index; optimize fuzzy matching with SmallVec |
| src/git/queries/commits.rs | Move tip/tag/stash enumeration + batching integration toward gix |
| src/git/gix.rs | New gix helper module: cache sizing, branch tip iteration, error conversion |
| src/git/auth.rs | Add gix credential adapter + make SSH key lookup testable |
| src/git/actions/tagging.rs | Migrate lightweight tagging to gix ref transactions + add tests |
| src/git/actions/submodules.rs | Migrate submodule sync/stage/unstage/update plumbing to gix |
| src/git/actions/staging.rs | Stage submodule pointers via new submodule model + stage_submodule_head |
| src/git/actions/resetting.rs | Wire in resetting tests module |
| src/git/actions/pushing.rs | Wire in pushing tests module |
| src/git/actions/gix_support.rs | New shared mutating gix helper layer (open repo/config edit/index write/head/checkout) |
| src/git/actions/fetching.rs | Migrate fetch to gix network plumbing + prune stale remote-tracking refs + add tests |
| src/git/actions/checkout.rs | Migrate checkout (detached/local/remote-tracking bootstrap) to gix refs/config/checkout |
| src/git/actions/branching.rs | Migrate create/delete/rename to gix ref transactions + explicit config edits |
| src/core/worktrees.rs | Change worktree HEAD type to gix ObjectId |
| src/core/submodules.rs | Change submodule OID fields to gix ObjectId |
| src/core/reflogs.rs | Change reflog time type to gix time |
| src/core/oids.rs | Rewrite Oids intern/prefix logic around gix ObjectId + IdHashMap |
| src/core/layers.rs | Reduce allocations by storing symbols as &str and flattened lanes as bytes; add unit tests |
| src/core/chunk.rs | Make Chunk Copy |
| src/app/input/worktrees.rs | Update alias lookup to new Oids API |
| src/app/input/remotes.rs | Pass repo path into new path-based remote query API |
| src/app/input/navigation.rs | Adjust commit lookup and alias lookup for new Oids API |
| src/app/input/modals.rs | Replace OID prefix search with Oids prefix API |
| src/app/input/git.rs | Switch default remote lookup to path-based API; adjust alias/oid getters |
| src/app/draw/stashes.rs | Adjust OID retrieval API usage |
| src/app/draw/settings.rs | Switch remotes rendering to path-based queries |
| src/app/draw/search.rs | Derive short OID display directly from OID formatting |
| src/app/draw/inspector.rs | Use gix time formatting for gix reflog entries |
| src/app/draw/graph.rs | Generalize line alignment function lifetime |
| src/app/app.rs | Add bootstrap/shutdown/wait-for-graph APIs; handle graph channel disconnect; accept worktree graph events |
| Cargo.toml | Add gix + supporting deps (iddqd, rustc-hash, smallvec, gix-worktree crates) |
| benches/render_graph_projection.rs | Refactor benchmark setup for updated GraphRow fields |
| benches/fixtures.rs | Update benchmark fixtures for new GraphRow fields |
| benches/commit_batching.rs | Update benchmarks for new Batcher API + gix repo usage |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on
mjc/gitoxide-spike-04-queries-readonly.Why this PR exists:
What changed:
git::actions::gix_supportas the shared helper layer for mutating gix operations:HEADref namesgit2::ErrorshapeHEADto an object or symbolic ref.gitmodulesHEADor remove it from the indexstage_submodule_head.Algorithm difference:
git2::checkout_head; it updatesHEADand checks out the target tree through gix.RemoteCallbacks/FetchOptions; it uses gix remote connection, refspec setup, credential callbacks, and pack receive.SubmoduleUpdateOptions; it opens or initializes the submodule repo, configures its remote, fetches through gix, checks out the target commit tree, and setsHEAD.Performance story:
Benchmark Results for this PR
Command shape:
hyperfine --warmup 5 './target/release/guitar /home/mjc/src/linux --exit-when-graph-complete'.CPU: M1 MacBook Pro 16GB
05-actions-network1.993s78.91x1.47s0.26s87%CPU: 5950x Linux/ZFS
05-actions-network1.862s53.30x1.60s0.49s112%Memory: 5950x Linux/ZFS
05-actions-network436.12M978.61MTop 10 heaptrack allocation sites for `05-actions-network`
190825 calls, 11.40M peak - git__calloc101577 calls, 0B peak - <>::next100831 calls, 0B peak - gix_dir::walk::readdir::recursive89663 calls, 1.27M peak - CRYPTO_malloc41425 calls, 1.61M peak - <>::finish_grow34119 calls, 0B peak - gix_ref::raw::convert::<>::from24684 calls, 0B peak - <>::push_back_tracked_path_component17060 calls, 878.18K peak - guitar::core::walker::Walker::new13654 calls, 0B peak - std::sys::fs::read_dir11854 calls, 154.43M peak - alloc::raw_vec::RawVecInner<>::finish_grow