Skip to content

Resizable message editor & quick reword feature - #2742

Open
d-tatianin wants to merge 2 commits into
sourcegit-scm:developfrom
d-tatianin:quick-reword
Open

d-tatianin wants to merge 2 commits into
sourcegit-scm:developfrom
d-tatianin:quick-reword

Conversation

@d-tatianin

Copy link
Copy Markdown

No description provided.

The editor used for interactive rebase rewords and for the standalone
`--rebase-message-editor` mode had a fixed size, which is cramped for
longer commit messages. Give it a default size, a minimum size and let
the editor stretch to fill the window.

Signed-off-by: Daniil Tatianin <99danilt@gmail.com>
Rewording a single commit currently requires going through the full
interactive rebase dialog. Add a `Quick Reword...` item to the commit
context menu that opens the commit message editor window and does the
rest without further confirmation:

- HEAD is amended with `git commit --amend --only`, which leaves staged
  changes untouched
- any other commit reachable from HEAD is reworded via a non-interactive
  `git rebase -i --autostash`, reusing the existing todo/message editor
  machinery with a generated job list (pick everything, reword target)

After the operation the reworded commit is re-selected in the history
view instead of the selection being reset to the top, since the commit
keeps the same distance from HEAD.

Signed-off-by: Daniil Tatianin <99danilt@gmail.com>
@love-linger

Copy link
Copy Markdown
Collaborator

If you want to reword the HEAD's commit, you can just enable Amend option in Local Changes page.

image

@love-linger love-linger self-assigned this Sep 24, 2026
@love-linger love-linger added not-planned It's not planned in the future already-done This feature already exists labels Sep 24, 2026
@d-tatianin

Copy link
Copy Markdown
Author

If you want to reword the HEAD's commit, you can just enable Amend option in Local Changes page.

image

I know, but this patch is not for rewording the HEAD commit. It's for rewording any commit at or below without entering the full interactive rebase wokflow, give it a try to see the difference. It also preserves the selection offset unlike interactive rebase (which can't really do that because you may e.g. drop or fixup a commit during one)

@love-linger

Copy link
Copy Markdown
Collaborator

It's for rewording any commit at or below without entering the full interactive rebase wokflow, give it a try to see the difference

I know. I readed your code before. But that's the point I really do not like. In fact, for rewording commits that are not HEAD, you are still performing a rebasing operation, but there is nowhere in your PR for users to know which subsequent commits will also be affected by this operation.

@d-tatianin

d-tatianin commented Sep 24, 2026 •

Copy link
Copy Markdown
Author

It's for rewording any commit at or below without entering the full interactive rebase wokflow, give it a try to see the difference

I know. I readed your code before. But that's the point I really do not like. In fact, for rewording commits that are not HEAD, you are still performing a rebasing operation, but there is nowhere in your PR for users to know which subsequent commits will also be affected by this operation.

Subsequent commits shouldn't be affected unless there's a bug in the program, unless you mean that this hides complexity from the user and you don't want that.

In this case I think at least commit 1 is useful on its own if you want to take that.

@love-linger

Copy link
Copy Markdown
Collaborator

Subsequent commits shouldn't be affected unless there's a bug in the program

  1. All subsequent commits will be re-picked one-by-one to the new reworded commit.
  2. Because the Commands.InteractiveRebase will always enable --autosquash option, when the subsequent commits contains fixup/amend/squash commits, it will be auto-squashed.

@d-tatianin

Copy link
Copy Markdown
Author

Subsequent commits shouldn't be affected unless there's a bug in the program

  1. All subsequent commits will be re-picked one-by-one to the new reworded commit.
  2. Because the Commands.InteractiveRebase will always enable --autosquash option, when the subsequent commits contains fixup/amend/squash commits, it will be auto-squashed.

Ah I see, that's an issue. If 2 was fixed, would you take this feature, or is 1 also a blocker in your opinion? (afterall, thats how rebasing in git works)

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

already-done This feature already exists not-planned It's not planned in the future

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants