Skip to main content

chp-adapter-git

CHP capability adapter for local Git repository inspection and operations.

Capabilities

Capability ID Risk Description
chp.adapters.git.status low Working tree status: branch, staged/unstaged/untracked counts
chp.adapters.git.inspect_repo low Repository overview: branch, HEAD SHA, remotes, commit count
chp.adapters.git.log low Recent commits list (sha7, author, subject, date)
chp.adapters.git.diff_summary low Diff statistics: files changed, insertions, deletions
chp.adapters.git.precommit_check low Staged file list + unstaged/untracked counts
chp.adapters.git.checkout_branch medium Create or switch to a branch
chp.adapters.git.commit medium Stage files and commit with a message

Evidence Hygiene

  • Diff content (patch text): never in evidence
  • File content: never in evidence
  • Commit messages: not in evidence (only sha7/count in events)
  • Commit subjects truncated to 80 chars in log output

Usage

from chp_core import LocalCapabilityHost, SQLiteEvidenceStore
from chp_adapter_git import GitAdapter, GitConfig

store = SQLiteEvidenceStore("evidence.db")
host = LocalCapabilityHost(store=store)
host.register_adapter(GitAdapter(config=GitConfig(default_repo_path="/path/to/repo")))

result = await host.ainvoke("chp.adapters.git.status", {})
print(result.output)  # {"branch": "main", "staged": 0, "unstaged": 1, "untracked": 2, "clean": False}

Testing with Injectable Backend

class FakeGitBackend:
    def run(self, *args, cwd=None):
        return {"rev-parse --abbrev-ref HEAD": "main"}.get(" ".join(args), "")

adapter = GitAdapter(config=GitConfig(backend=FakeGitBackend()))

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

chp_adapter_git-0.11.0.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

chp_adapter_git-0.11.0-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file chp_adapter_git-0.11.0.tar.gz.

File metadata

  • Download URL: chp_adapter_git-0.11.0.tar.gz
  • Upload date:
  • Size: 10.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for chp_adapter_git-0.11.0.tar.gz
Algorithm Hash digest
SHA256 f9913d64a94510636d403c69e4c13c5ff79b69d853a58cf24ff9e8dc9a98d6b7
MD5 36c6d89a06bb14a64fa054468a6a4f96
BLAKE2b-256 880d32e2a21d843827e4291dcad97441caac7ba23af01144ba31acbca7122da5

See more details on using hashes here.

File details

Details for the file chp_adapter_git-0.11.0-py3-none-any.whl.

File metadata

File hashes

Hashes for chp_adapter_git-0.11.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c2e5fd0f38decae81ac001c061d20edc770b0d36c8c980896c89a47e3c63f5d3
MD5 c06b1d7a89117b05f155ff90f4126b33
BLAKE2b-256 25ecf918ecedf8e0dbc873dbf8eec8652585a9dfa2977908463c5b7792064d6b

See more details on using hashes here.

Release history Release notifications | RSS feed

0.28.0

2 files

0.27.0

2 files

0.26.0

2 files

0.25.0

2 files

0.24.0

2 files

0.23.0

1 file

0.22.0

2 files

0.21.0

2 files

0.20.0

2 files

0.19.0

2 files

0.18.0

2 files

0.17.0

2 files

0.16.0

2 files

0.15.0

2 files

0.14.0

2 files

0.13.1

2 files

0.13.0

2 files

0.12.0

2 files

This release

0.11.0 This release

2 files

0.10.0

1 file

0.8.0

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page