Skip to content

Conversation

@brendan-kellam
Copy link
Contributor

@brendan-kellam brendan-kellam commented Jan 27, 2026

This PR updates the repo indexing path to generate a commit-graph on clone / fetch to accelerate commit traversal operations. The commit-graph is a pre-computed file that stores commit metadata (OIDs, parent pointers, timestamps, generation numbers) in a format optimized for sequential reads. This speeds up operations like rev-list --count, log, and merge-base significantly on large repositories.

See: https://git-scm.com/docs/commit-graph

NOTE: Local repositories will not have a commit graph generated for them.

Summary by CodeRabbit

  • Performance
    • Commit graph generation is now triggered after cloning and during fetch to speed up operations that traverse commit history.
  • Documentation
    • Added guidance on creating and updating commit graphs for local repositories and clarified related examples.

✏️ Tip: You can customize this high-level summary in your review settings.

@github-actions

This comment has been minimized.

@coderabbitai
Copy link

coderabbitai bot commented Jan 27, 2026

Caution

Review failed

The pull request is closed.

Walkthrough

Adds Git commit-graph generation: graphs are written after cloning, fetch now requests commit-graph updates, and a new exported writeCommitGraph utility allows manual graph creation with non-fatal error handling. (47 words)

Changes

Cohort / File(s) Summary
Changelog
CHANGELOG.md
Added "Changed" entry noting commit graph generation for commit traversal performance.
Git operations
packages/backend/src/git.ts
After clone, invoke commit-graph generation; add --write-commit-graph to fetch; export writeCommitGraph() which runs git commit-graph write --reachable with debug-logged, non-fatal errors.
Docs
docs/docs/connections/local-repos.mdx
New "Optimizing git operations" section describing commit-graph usage and manual commands for local repos; minor formatting cleanup.

Sequence Diagram(s)

mermaid
sequenceDiagram
participant Cloner as Cloner
participant GitCLI as Git CLI
participant RepoFS as Repository (FS)
Cloner->>GitCLI: git clone
GitCLI-->>RepoFS: write repository data
Cloner->>GitCLI: writeCommitGraph(path)
GitCLI-->>RepoFS: git commit-graph write --reachable
Note over GitCLI,RepoFS: Errors logged as debug; non-fatal

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'chore(worker): Improve git operation perf' accurately reflects the main change in the changeset - adding commit-graph generation to improve performance for git operations, particularly commit traversal.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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 and usage tips.

@brendan-kellam brendan-kellam merged commit c396b2d into main Jan 27, 2026
8 of 9 checks passed
@brendan-kellam brendan-kellam deleted the bkellam/commit-perf branch January 27, 2026 04:12
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.

2 participants