Repository navigation
fix(publish): resume a partial publish by reusing the release commit - #709
Merged
Merged
Conversation
Re-running `publish` on the same tree after a failure past the commit stage failed at `git commit` (nothing to commit). The commit stage now reuses HEAD when nothing is staged and HEAD's subject matches the release commit message, and still throws GIT_COMMIT_ERROR otherwise. A reused commit leaves `git.committed` false, so `changed` reports only what the re-run did. The push stages still push the branch for a reused commit. Adds `hasStagedChanges` to the `@releasekit/git` seam. Closes #707 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
Standing release PR: #614 · v0.42.0 queued (4 packages) · open 82d 20h 45m · ✅ ready to merge Release Preview — v0.41.2 → v0.42.0
These changes will be added to the release PR (#614) when merged: Changelogmonorepo 0.41.2 → 0.42.0
After merge — predicted release
Updated automatically by ReleaseKit |
Git's `%s` joins the first paragraph's lines with spaces, so a release message with a second line directly under the subject never matched its own first line and couldn't resume. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
goosewobbler
force-pushed
the
fix/707-resume-partial-publish
branch
from
October 23, 2026 14:31
e3e8fa2 to
59ccb82
Compare
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 23, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Standalone
publishcouldn't resume after a failure past the commit stage: the re-run found nothing to commit and failed atgit commitbefore any later stage was retried.git add, if nothing is staged and HEAD's subject matches the release commit message, it reuses HEAD and goes on to tagging (tags already at HEAD were already skipped). If nothing is staged and HEAD isn't the release commit, it throwsGIT_COMMIT_ERRORnaming both subjects. A dry run skips theadd, so it commits as before.changedstays accurate:git.committedstays false for a reused commit, sopublishDidChangecounts only what the re-run did.skipGitCommit) is unchanged and still pushes tags only.@releasekit/git: newhasStagedChanges()(diff --cached --quiet) onGit,GitCliandFakeGit.docs/cli.mddescribes resuming instead of "isn't supported yet".Related Issue(s)
Closes #707.
Type of Change
feat— New featurefix— Bug fixdocs— Documentation changerefactor— Code refactoringtest— Adding or updating testschore— Maintenance, dependencies, toolingScope
@releasekit/version@releasekit/notes@releasekit/publish@releasekit/release@releasekit/config@releasekit/coreChecklist
pnpm lint)pnpm test)pnpm typecheck)Testing Notes
test/integration/resume-publish.spec.tsuses real git and a bare remote. The firstreleasekit publish --inputfails at the push (exit 9,changed: true); afteroriginis fixed, the re-run succeeds withchanged: false. It asserts exactly one release commit, and that the branch andv0.2.0reached the remote at HEAD. It fails without the fix: atgit commit, or on the missing remote branch with only the commit-stage change.runGitPushStage,preparePushSetupandpushPackageTag;publishDidChangefalse for a reused commit;hasStagedChangesinGitCliandFakeGit.🤖 Generated with Claude Code


Confidence Score: 5/5
The PR appears safe to merge; the previous multiline-message issue is fixed.Summary
Allows a partial publish to resume by reusing the release commit.
Diagram
%%{init: {'theme': 'neutral'}}%% flowchart TD A[Stage release files] --> B{Any staged changes?} B -->|Yes| C[Create release commit] B -->|No| D{HEAD subject matches?} D -->|No| E[Stop with commit error] D -->|Yes| F[Reuse release commit] C --> G[Create missing tags] F --> G G --> H[Continue publishing and push branch and tags]Reviews (2) · Last reviewed commit: "fix(publish): compare the release commit..." · Reviewed by Greptile