Class GoalCommitLedger

java.lang.Object
network.ike.plugin.ws.GoalCommitLedger

public final class GoalCommitLedger extends Object
The committed-work ledger of a publish goal (IKE-Network/ike-issues#954).

A publish goal that owns its commits (#919, #780) ends by showing the operator exactly what it committed — not a working-tree status check, which is empty by design once every goal-authored change is committed. The ledger derives that inventory from git truth: the caller records each repository's HEAD immediately after the goal's preflight proved the tree free of uncommitted changes (baselineSha), lets the goal run, then collects git log --name-status baseline..HEAD per repository. Because the preflight guaranteed a committed baseline, every commit in the range is provably goal-authored — including commits made by delegated subprocesses (the per-subproject ike:scaffold-publish fan-out) that the workspace mojo cannot otherwise observe.

  • Method Details

    • baselineSha

      public static String baselineSha(File dir)
      The repository's current HEAD short SHA, for use as the ledger baseline — or null for a repository with no commits yet (an unborn HEAD), in which case the whole history at collect time is goal-authored.
      Parameters:
      dir - the repository root directory
      Returns:
      the baseline short SHA, or null when the repository has no commits yet
    • collect

      public static GoalCommitLedger.RepoChanges collect(String label, File dir, String baselineSha)
      Collect one repository's ledger entry: the goal-authored commits in baseline..HEAD (each with subject, short SHA, and changed files) plus any uncommitted residue. Collection is best-effort — a repository whose log cannot be read (e.g. HEAD still unborn) reports no commits rather than failing the goal's report.
      Parameters:
      label - the repository label shown in reports
      dir - the repository root directory
      baselineSha - the HEAD recorded by baselineSha(File) before the goal ran; null means the repository had no commits then, so the whole history is goal-authored
      Returns:
      the repository's ledger entry