Skip to content

feat: reword non-HEAD commit messages, and add Combine Commits action - #44

Open
rkaiser0324 wants to merge 1 commit into
git-hub-tig:masterfrom
rkaiser0324:feat/reword-combine-commits
Open

feat: reword non-HEAD commit messages, and add Combine Commits action#44
rkaiser0324 wants to merge 1 commit into
git-hub-tig:masterfrom
rkaiser0324:feat/reword-combine-commits

Conversation

@rkaiser0324

Copy link
Copy Markdown

Extends the existing "Edit Message" action to support non-HEAD commits (previously rejected with "Editing commit messages for non-HEAD commits is not yet supported."), and adds a new "Combine Commits..." action that squashes a range of commits (selected via the existing compare/expand commit UI) into one, with a user-supplied message.

Both are implemented as a single interactive rebase, driven by two small standalone Node helper scripts (compiled to out/rebaseSequenceEditor.js and out/rebaseMessageEditor.js) set as GIT_SEQUENCE_EDITOR and GIT_EDITOR - the message is collected via the existing dialog UI before the rebase starts, so no editor window is opened and no interactive rebase state is left for the user to resolve on cancel.

UI changes

  • "Edit Message..." (existing) now works for any commit, not just HEAD.
  • New "Combine Commits..." action, gated behind a combineCommits context-menu-visibility setting (same convention as editMessage) — also backfilled the two missing editMessage/combineCommits entries in the package.json settings schema.
  • The Combine Commits dialog's textarea defaults to all the original commit messages concatenated (oldest first).
  • Both dialogs are now double-width/double-height ("large") — previously bounded by a fixed 360px width. Applied automatically to any dialog with a Textarea input. This is to support longer commit messages.
  • Fixed textarea styling to match the existing text input fields (gray background, rounded border) — affects the existing Edit Message dialog too.

Testing

  • npm run compile (lint + backend + frontend) passes clean.
  • npm test: no regressions — failure count/suite list identical before and after.
  • Verified the rebase mechanics end-to-end outside the extension (real git rebase -i runs) for both reword and combine.

Extends the existing "Edit Message" action to support non-HEAD commits (previously
rejected with "Editing commit messages for non-HEAD commits is not yet supported."),
and adds a new "Combine Commits..." action that squashes a range of commits (selected
via the existing compare/expand commit UI) into one, with a user-supplied message.

Both are implemented as a single interactive rebase, driven by two small standalone
Node helper scripts (compiled to out/rebaseSequenceEditor.js and
out/rebaseMessageEditor.js) set as GIT_SEQUENCE_EDITOR and GIT_EDITOR - the message is
collected via the existing dialog UI before the rebase starts, so no editor window is
opened and no interactive rebase state is left for the user to resolve on cancel.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant