Class GoalAuthoredChanges
java.lang.Object
network.ike.plugin.ws.GoalAuthoredChanges
Commit only the paths a goal itself authored, safely — the reusable
primitive behind the
AuthoredCommit.IN_ISOLATION contract
(IKE-Network/ike-issues#780). Generalized from PostMutationSync's
workspace.yaml self-commit (IKE-Network/ike-issues#774).
Usage: snapshot the paths the goal is about to write,
before it writes them; let the goal run; then
commitAuthored. Only paths that were unmodified
before the goal ran and were modified by it are committed — so a
caller's concurrent WIP, a -DstagedOnly subset, work syncing in over
Syncthing, or a not-yet-bootstrapped sibling's untracked state is never
swept in. The helper never runs git add -A; it commits exact paths
via VcsOperations.commitPaths(File, Log, String, String...).
-
Method Summary
Modifier and TypeMethodDescriptionbooleancommitAuthored(String message) Commit, in isolation, exactly the snapshotted paths that were unmodified before the goal ran and have since been modified by it.static GoalAuthoredChangesSnapshot, before the goal runs, which ofpathsare currently unmodified in the working tree.
-
Method Details
-
snapshot
public static GoalAuthoredChanges snapshot(File root, org.apache.maven.api.plugin.Log log, String... paths) Snapshot, before the goal runs, which ofpathsare currently unmodified in the working tree. Only those become eligible to be committed in isolation later — a path that already carries a user or caller edit is excluded, so a later commit can never sweep that edit in.- Parameters:
root- the repository root directorylog- Maven loggerpaths- the paths the goal intends to author, relative toroot- Returns:
- a snapshot to
commitAuthored(String)after the goal has run
-
commitAuthored
Commit, in isolation, exactly the snapshotted paths that were unmodified before the goal ran and have since been modified by it. A no-op (returnsfalse) when no such path exists. A commit failure is logged at WARN and treated as a no-op rather than aborting the caller.- Parameters:
message- the commit message — a<type>: <summary>line plus aRefs:trailer; must not benullor blank- Returns:
trueif a commit was made
-