Skip to content

chore(core): drop the unused git2 dependency - #14

Merged
senamakel merged 1 commit into
mainfrom
move-git-to-tinycortex
Aug 14, 2026
Merged

chore(core): drop the unused git2 dependency#14
senamakel merged 1 commit into
mainfrom
move-git-to-tinycortex

Conversation

@senamakel

@senamakel senamakel commented Aug 14, 2026

Copy link
Copy Markdown
Member

Summary

Drop the git2 dependency from tinymemory-core. It had no use behind it: memory-git now forwards tinycortex/git-diff + tinycortex/wiki-git only.

Problem

core/Cargo.toml declared git2 = { version = "0.21", optional = true, … } and memory-git = ["dep:git2", "tinycortex/git-diff", "tinycortex/wiki-git"].

git2 is never used in this crate. Every mention of it in core/src/ is a doc comment — diff/mod.rs, diff/ops.rs and store/content/mod.rs describe the gate, they do not open a repository. diff/ holds the ops and the stubs around the ledger; the ledger itself lives in tinycortex, which is where every libgit2 call in the stack is.

An optional dependency with nothing behind it is not free. It is a second pin on git2, free to drift off tinycortex's, and git2 sets links = "git2" — two majors in one graph is a hard cargo error rather than a warning. It also misrepresents where the native build enters the graph, which matters to a host reading this manifest to decide what memory-git costs.

Solution

Remove the declaration and dep:git2 from the feature. memory-git reaches the libgit2 cohort exactly as before, by turning on tinycortex's two git features — that is what it always did; the local dep:git2 was pulling a crate into the graph that this crate then never called.

Replaced the declaration with a note saying not to add it back and why, and corrected the memory-git feature comment to say the cohort arrives by way of tinycortex.

No behaviour change and no change to what a memory-git build links: git2 was already in the graph through tinycortex whenever the gate was on, so cargo unified the two.

Impact

  • Cargo.lock: git2 is no longer listed under tinymemory-core's dependencies. It remains under tinycortex, which is now its only parent.
  • Feature-off builds are unaffected — the gate still sheds git2 / libgit2-sys / libz-sys in full.

Validation

  • cargo check --workspace --all-targets (default features) — clean.
  • cargo check -p tinymemory-core --features memory-git --all-targets — clean.
  • Verified from the OpenHuman host: cargo tree -e normal -i git2 --features memory-git lists tinycortex as the sole source, and cargo check is clean with the gate both on and off and on the full product feature set.

Related

Summary by CodeRabbit

  • Refactor
    • Streamlined internal Git integration without changing exported functionality.
    • Existing memory and Git-related features continue to work as before.

`diff/` holds the ops and the stubs around the ledger; it never opens a
repository. Every libgit2 call in the stack is tinycortex's, and
`memory-git` already reaches it by forwarding `tinycortex/git-diff` +
`tinycortex/wiki-git`. The optional `git2` declaration had no `use`
behind it and was free to drift off tinycortex's major, which
`links = "git2"` turns into a hard cargo error.

Co-authored-by: Medulla <medulla@tinyhumans.ai>
@coderabbitai

coderabbitai Bot commented Aug 14, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: fe40a300-ef32-497e-ac80-4548d8becd6f

📥 Commits

Reviewing files that changed from the base of the PR and between 1e2338a and 544d490.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (1)
  • core/Cargo.toml

📝 Walkthrough

Walkthrough

The change removes the optional vendored git2 dependency from tinymemory-core. The memory-git feature now enables Git functionality through tinycortex.

Changes

Git dependency ownership

Layer / File(s) Summary
Forward Git features through tinycortex
core/Cargo.toml
Removes the optional git2 dependency and updates memory-git to retain only the tinycortex/git-diff and tinycortex/wiki-git features.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 544d4

This removes an unused dependency while preserving the existing git feature path and build behavior; no actionable merge-blocking risk remains after normal checks and review.

Poem

I hop past git2 in the crate,
Tinycortex now owns the gate.
Two Git features bloom in line,
The memory path stays neat and fine.
— A pleased rabbit 🐇

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the removal of the unused optional git2 dependency from core.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@senamakel
senamakel merged commit ed524f1 into main Aug 14, 2026
11 of 12 checks passed
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.

1 participant