Skip to content

M5-PY3: GitService compatibility shim for gila git-tend adoption #35

Description

@hartsock

Summary

A drop-in GitService class that routes all 20 git-tend GitService methods to gitxtend.*. Enables the gila git-tend plugin to adopt gitxtend with a one-line import swap, with no other changes.

Blocked By

New File: python/gitxtend/compat.py

import subprocess
from pathlib import Path
import gitxtend

class GitService:
    """Drop-in replacement for gila_plugin_git_tend.services.git_service.GitService.

    Routes all methods to gitxtend compiled primitives.
    Write methods return subprocess.CompletedProcess-compatible objects
    to preserve the calling contract.
    """
    def is_git_repo(self, path: Path) -> bool:
        return gitxtend.is_git_repo(path)
    # ... all 20 methods

Write methods (pull, push, add, commit, stash_push, stash_pop,
create_branch, reset_hard) return a mock CompletedProcess-like object
with returncode, stdout, stderr attributes so callers don't change.

Modified Files

  • python/gitxtend/__init__.py — export GitService from compat
  • python/gitxtend/__init__.pyi — stub for GitService

Acceptance Criteria

Replace in gila git-tend:

# Before:
from gila_plugin_git_tend.services.git_service import GitService
# After:
from gitxtend import GitService

All gila-plugin-git-tend tests still pass with this swap.

Beaver (MacBook agent, Claude Sonnet 4.6)

Metadata

Metadata

Assignees

No one assigned

    Labels

    milestone:M5Python Library (v0.5.0)pythonPython implementation

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions