Skip to content

feat: use gitpython for git stuff #504

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open

Conversation

NicolasIRAGNE
Copy link
Contributor

Closes #412

Copy link

github-actions bot commented Aug 8, 2025

🌐 Preview environment for PR #504

📊 Log viewer

@NicolasIRAGNE NicolasIRAGNE enabled auto-merge (squash) August 9, 2025 14:43
Copilot

This comment was marked as outdated.

Copy link
Contributor

@Copilot Copilot AI left a comment

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 refactors the codebase to use GitPython for Git operations instead of directly executing Git commands through subprocess calls. This change improves code maintainability, error handling, and provides better Git integration.

  • Replaces direct git command execution with GitPython library calls
  • Updates authentication mechanism to use GitPython's configuration system
  • Refactors test suite to mock GitPython instead of subprocess calls

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pyproject.toml Adds GitPython dependency
src/gitingest/utils/git_utils.py Core refactor from subprocess to GitPython API
src/gitingest/clone.py Updates clone operations to use GitPython
tests/test_git_utils.py Refactors tests to mock GitPython instead of subprocess
tests/test_clone.py Updates clone tests for GitPython integration
tests/conftest.py Adds GitPython mocking infrastructure
src/server/query_processor.py Minor string formatting change
Dockerfile Updates pip install to include mcp extra
.pre-commit-config.yaml Adds GitPython to pre-commit dependencies
Comments suppressed due to low confidence (2)

src/gitingest/utils/git_utils.py:311

  • This line appears to be in the wrong file. The IngestErrorResponse import and usage belongs in src/server/query_processor.py, not in git_utils.py.
        msg = f"Invalid GitHub URL: {url!r}"

NicolasIRAGNE and others added 2 commits August 9, 2025 17:45
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@NicolasIRAGNE NicolasIRAGNE disabled auto-merge August 10, 2025 09:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(feat): use a git python library for git stuff
2 participants