CodeEditApp / CodeEditApp/CodeEdit

👀 Proposal: Integrate SwiftGitX as an Alternative to the Current Git Implementation

Abierto
#1,987 2 comentarios 0 reacciones 0 asignados Ver en GitHub
bug feedback output performance tests
Lenguaje dominante
Swift
Estrellas
23k
Forks
1.2k
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

I would like to propose integrating [SwiftGitX](https://github.com/ibrahimcetin/SwiftGitX) into CodeEdit as an alternative to the current `GitClient` implementation that relies on executing Git shell commands.

## Background

Currently, CodeEdit uses a `GitClient` class that wraps Git shell commands by spawning subprocesses, capturing output, and then parsing the results to build models. While this approach works, it has some limitations:

- Performance Overhead: Each Git operation requires spawning a new process, which can be slow compared to directly interacting with Git data structures.

- Error Handling: Parsing command-line output can be fragile and error-prone, as Git’s output format may change between versions.

- Dependency on Git Executable: The current approach requires the Git binary to be installed and available in the system’s PATH.

## About SwiftGitX

SwiftGitX is a Swift-native wrapper around libgit2, providing a structured and efficient way to interact with Git repositories programmatically. Key advantages include:

- Direct Interaction with Git Repositories: No need for shell commands; everything is handled in Swift.

- Better Performance: By avoiding process spawning and output parsing, operations are faster and more efficient.

- **No External Dependencies**: SwiftGitX does not require an external Git installation; it can be added as a Swift package and works out of the box.

- **Well-Tested**: The library includes more than 100 unit tests and 90% test-coverage, ensuring reliability and stability.

## Proposed Plan for Incremental Integration

To avoid a large and disruptive refactor, I propose an incremental approach:

1. Introduce SwiftGitX as an optional dependency – Add SwiftGitX to the project while keeping the existing GitClient implementation.

2. Implement Core Functionality – Start by replacing a small subset of Git operations (e.g., getting repository status, listing branches) to validate the integration.

3. Expand Coverage – Gradually replace more Git operations with SwiftGitX where it provides clear advantages.

4. Evaluate and Optimize – Compare performance, reliability, and maintainability before considering a full migration.

## Next Steps

I’d love to discuss this proposal with the maintainers and contributors of CodeEdit. If this approach sounds reasonable, I can start working on the initial integration and provide PRs step by step.

Looking forward to your feedback!

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Empieza leyendo la implementación existente de GitClient y la configuración de dependencias del proyecto para comprender la integración actual de shell-command. La propuesta no identifica archivos ni pruebas específicos; para darlo por terminado se necesitaría acordar una integración incremental de SwiftGitX, operaciones iniciales como consultar el estado del repositorio o listar ramas, y cobertura de evaluación.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
git, swift
Área
developer-experience, tooling
Tipo de issue
Nueva funcionalidad
Dificultad
5/5
Tiempo estimado
Más de una semana
Estado de actividad
Estancado
Claridad
Necesita aclaración
Aptitud para principiantes
20/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.