Class GitConfigAdapter
java.lang.Object
network.ike.plugin.scaffold.GitConfigAdapter
- All Implemented Interfaces:
ModelAdapter
Model adapter for git config files (
~/.gitconfig or a
repository's .git/config).
Git config is an INI-flavoured format: sections like
[core] and [alias "co"] (a subsection) contain
key = value pairs. This adapter parses the format
line-by-line, preserving comments and unknown sections verbatim,
and ensures named keys are present under named sections.
Supported ensure subtree:
ensure:
core:
autocrlf: "false"
excludesfile: "~/.gitignore_global"
"alias":
st: "status -sb"
Keys under each section are ensured independently. If a key is already present with any value, the user's value wins (we don't overwrite), but the key is still recorded as managed. Missing keys get appended to the end of the matching section, or a new section is created at end of file if the section itself is missing.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionModel name this adapter handles, matchingManifestEntry.model()(e.g.plan(ManifestEntry entry, Path resolvedDest, byte[] currentContent, LockfileEntry priorEntry, String currentStandardsVersion) Plan a single model-managed entry.
-
Field Details
-
MODEL_NAME
-
-
Constructor Details
-
GitConfigAdapter
public GitConfigAdapter()Construct a stateless git-config adapter. Instances are safe to share across planning calls; all per-invocation state lives on method parameters.
-
-
Method Details
-
modelName
Description copied from interface:ModelAdapterModel name this adapter handles, matchingManifestEntry.model()(e.g."maven-settings-4").- Specified by:
modelNamein interfaceModelAdapter- Returns:
- the model name; never
null
-
plan
public ModelPlanResult plan(ManifestEntry entry, Path resolvedDest, byte[] currentContent, LockfileEntry priorEntry, String currentStandardsVersion) Description copied from interface:ModelAdapterPlan a single model-managed entry.- Specified by:
planin interfaceModelAdapter- Parameters:
entry- the manifest entry; must haveScaffoldTier.MODEL_MANAGEDtier andmodel()equal toModelAdapter.modelName()resolvedDest- absolute destination path (placeholders already expanded)currentContent- bytes currently on disk atresolvedDest, ornullif no file existspriorEntry- lockfile entry from the last publish, ornullif never appliedcurrentStandardsVersion- thestandards-versionof the current manifest; stamped on newly-installed elements so drift can be reasoned about later- Returns:
- a
ModelPlanResultwith both aTierActionand the element-level provenance for the lockfile
-