Skip to content

Bound the fi message and say what each run changed - #24

Merged
chris-peterson merged 1 commit into
mainfrom
keep-the-ci-commit-message-from-growing-on-fi
Oct 25, 2026
Merged

chris-peterson merged 1 commit into
mainfrom
keep-the-ci-commit-message-from-growing-on-fi

Conversation

@chris-peterson

@chris-peterson chris-peterson commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Context

git-fi keeps fi's branch list in the fi commit message. Under CI, each rebuild quoted the whole previous message after "Was originally: ---", so the message grew by one rebuild every time. Two CI rebuilds into a real repo's fi (branch names and build numbers anonymized):

Re-merge fi branch triggered by build 1002 due to commit on feature-c. Was originally: --- Re-merge fi branch triggered by build 1001 due to commit on feature-c. Was originally: --- Merge remote-tracking branches 'origin/feature-a', 'origin/feature-b' and 'origin/feature-c' into fi

Merge remote-tracking branches 'origin/feature-a', 'origin/feature-b' and 'origin/feature-c' into fi

Merge remote-tracking branches 'origin/feature-a', 'origin/feature-b' and 'origin/feature-c' into fi

Every fi message is now at most three paragraphs: the CI build line (CI only), a line naming what the run added and removed (left out when neither), and the signature, which stays last and is the only part parseBranchList reads. Nothing carries over from the previous message, so a message no longer says how fi got here, only what this run did. Existing bloated fi commits still parse and shrink on their next rebuild. The signature format is unchanged; switching to terse stays with #3.

What each catalyst writes, from this branch's build against a throwaway repo:

git fi -a feature-d

Added feature-d.

Merge remote-tracking branches 'origin/feature-a', 'origin/feature-b', 'origin/feature-c' and 'origin/feature-d' into fi

git fi -r feature-b

Removed feature-b.

Merge remote-tracking branches 'origin/feature-a', 'origin/feature-c' and 'origin/feature-d' into fi

git fi -f feature-a feature-e

Added feature-e; removed feature-d.

Merge remote-tracking branches 'origin/feature-a' and 'origin/feature-e' into fi

git fi -g, nothing to prune

Merge remote-tracking branches 'origin/feature-a', 'origin/feature-c' and 'origin/feature-d' into fi

git fi -g in CI, after feature-c landed on main

Re-merge fi branch triggered by build 1002 due to commit on main.

Removed feature-c.

Merge remote-tracking branches 'origin/feature-a' and 'origin/feature-d' into fi

Review guide

Core

  • src/merge.ts the change line. Names are bare so a reader that scans the whole message for 'origin/…' (the Ruby gem's did) can't read a removed branch back
  • src/merge.ts the prior list comes from origin/fi as fetched, so --remove, --force, and pruning all show up as removals
  • SPEC.md new STORAGE-05; MERGE-13 now covers only the build line

Tests

  • test/fi-message.test.ts drives the built binary: six CI rebuilds at constant size, a 50-rebuild bloated message, removal, and the message written outside CI

Skim

Validation

  • Rebuilt a real repo's bloated fi: git fi -g with this branch's build, run locally on an internal service repo. Observed: the message went from two stacked CI preambles and three copies of the signature to the signature alone

@chris-peterson chris-peterson self-assigned this Oct 21, 2026
@chris-peterson chris-peterson added bug Something isn't working enhancement New feature or request labels Oct 21, 2026
@chris-peterson chris-peterson added this to the 1.4 milestone Oct 21, 2026
Under CI, each rebuild embedded the whole previous fi message after
"Was originally: ---" and appended a new signature, so every message
carried every earlier one. After a few weeks of rebuilds the subject
was a long chain of builds and the body a stack of identical
signatures.

The Ruby gem this was ported from quoted only the last commit a person
made: it split the previous message on its first "---", dropping the
old robot preamble. It needed that quote because its CI commits had no
signature of their own, and its reader scanned the whole message for
'origin/...' names. The port read the previous message whole, so the
quote nested on every rebuild.

Every fi message is now an optional CI pipeline line, a line naming
the branches the run added and removed (left out when neither), and
the signature (MERGE-13, STORAGE-05). Its size depends only on the
operation. The change line names branches bare, so a reader that scans
the whole message for 'origin/...' can't take a removed branch as
still in fi; quoting the previous signature would have left exactly
that stale list behind. One builder, buildSignature, writes the
signature in either format.

parseBranchList still reads only the final paragraph, so an existing
bloated fi parses correctly and returns to the short form on its next
re-merge. The signature format is unchanged; the switch to terse
stays with #3.
@chris-peterson
chris-peterson force-pushed the keep-the-ci-commit-message-from-growing-on-fi branch from e7cb0a0 to 915a1b5 Compare October 25, 2026 19:34
@chris-peterson
chris-peterson marked this pull request as ready for review October 25, 2026 19:42
@chris-peterson
chris-peterson merged commit cb6b76b into main Oct 25, 2026
9 checks passed
@chris-peterson
chris-peterson deleted the keep-the-ci-commit-message-from-growing-on-fi branch October 25, 2026 21:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant