Git Operations
Git Operations Architecture
Separate repository policy from low-level Git command execution and version-tag interpretation.
app/core/git_ops/Category
Quick Command
consumer -> GitService -> IGitCommandExecutor -> gitOverviewâ
Custy keeps subprocess syntax in GitCommandExecutor and repository decisions
in GitService. Callers such as the workflow engine, changelog providers,
branch cleanup, branch workflow, and version strategies normally depend on the
service instead of assembling git command arguments themselves.
Git Stack
Factory
git/factory.py
Creates GitCommandExecutor, obtains the shared ConfigLoader, and returns a
fully wired GitService with optional version strategy context.
Executor Protocol
git/protocol.py
Defines the command-level operations required by the service, including repository, branch, remote, log, tag, commit, stage, and push calls.
Command Executor
git/executor.py
Builds explicit git argument lists, delegates subprocess behavior to
Runner, and normalizes results into CommandResult.
Git Service
git/service.py
Applies high-level policy, parses results, resolves remotes, selects tag sorters, logs operations, and raises meaningful operation failures.
Operation Flow
Workflow Timeline
Service Capabilities
Repository and History
Detect repository and commit state.
Inspect, list, compare, and delete local or remote branches.
Read hashes, messages, ranges, counts, dates, and structured commits.
Select and cache a strategy-aware TagSorter.
Mutating Operations
Stage all, tracked updates, or explicit files and inspect the index.
Create local history from resolved messages and flags.
Push HEAD or selected tags to one or more resolved remotes.
Apply local and remote cleanup selected by the branch service.
Dry-Run Boundary
GitCommandExecutor inherits DryRunSupport, which owns a Runner. In dry-run
mode, operations explicitly marked as read-only still execute so callers can
inspect real repository history, branches, tags, status, and configured
remotes. Mutating operations are reported as simulated and return a successful
CommandResult whose skipped state distinguishes them from executed discovery.
Higher layers may still resolve configuration, read project files, validate inputs, render previews, or perform other non-mutating work. Custy's normal diagnostic logging can also write to its configured log file. Dry-run is a mutation boundary, not a transaction or rollback mechanism.
Policy Above the Service
The workflow engine still owns release-specific decisions such as whether to
push backup remotes, whether a branch is non-critical, when to prompt for a
fallback remote, and whether to push the current tag. This keeps GitService
reusable, but it means remote behavior is shared between workflow policy and
service-level resolution rather than centralized in one object.