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
logoutput
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.13.1.tar.gz
(10.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file chp_adapter_git-0.13.1.tar.gz.
File metadata
- Download URL: chp_adapter_git-0.13.1.tar.gz
- Upload date:
- Size: 10.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4774ad91e6ed86451fe509df380c89a80abea1e0a79942a0e05d3f9f210899c9
|
|
| MD5 |
5a6a954ccce234f69ae13323bfb92369
|
|
| BLAKE2b-256 |
cdb3a84a1998fcb8f57098edee297693e1c07a67b9f93b5af1d6c97f62e74f41
|
File details
Details for the file chp_adapter_git-0.13.1-py3-none-any.whl.
File metadata
- Download URL: chp_adapter_git-0.13.1-py3-none-any.whl
- Upload date:
- Size: 7.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9605f7a602a0b88ea61c8e0365dd8391e9d1309f4cf8fa7599970d59c6dddd8c
|
|
| MD5 |
76b0eca633c32bdf0ce52e85cf6f0e8d
|
|
| BLAKE2b-256 |
61f01db5da65293bc87c11261b4cd7a567e650dd2650e624b8fee0547630a1da
|