sourcegit-scm/sourcegit

In Interactive Rebase, the "Edit (stop for amending)" option should let us re-apply original message

Closed this issue · 1 comments

When doing an Interactive Rebase and choosing "Edit (stop for amending)", it should be easy to re-apply the original message from the edited/amended commit.

A minimal (simplistic) implementation of this could be as follows:

  • Each time we're "stopping to amend" a commit, add the original message from that commit to the "(No) Recent Input Messages" list (inside the "Template/Histories" popup, below the Commit Subject/Description part of the "Local Changes" view).
  • Preferably, also make sure the original message displays "at the top" of that list.

A slightly more involved (but nicer) implementation would do this:

  • Each time we're "stopping to amend" a commit, pre-fill the original message from that commit into the Commit Subject/Description edit-boxes (on the "Local Changes" view).

NOTE: I'm aware that we can choose "Reword (Edit the commit message)", but there are use cases where we want to make more edits than just rewording the message, or maybe we want to change other things but NOT the message.

In my particular use case, I wanted to keep the original message and simply re-commit with the "SignOff" (--signoff) option enabled (which was disabled when I originally did the commit). This worked fine, EXCEPT for the nuisance of having to manually copy the original message back into the commit. Here are the steps I used :

  • Choose "Interactively Rebase patch-1 on Here" at a previous commit.
  • In the "Interactive Rebase" window, change from "Pick" to "Edit" on the commit I want to fix.
  • Press "Start" --> Rebase in progress. Stopped at [commit being edited]
  • Choose "Reset (no branch, rebasing patch-1) to Here" at the parent commit (of the one being edited).
  • Choose Reset Mode "Soft (Keep all changes. Stage differences.)" Press OK.
  • Go to the "Local Changes" view and toggle the "SignOff" checkbox to ✔.
  • Here, I had to go back to "History" view and copy-paste the original message (from the commit that's now being edited) into the Commit Subject/Description edit-boxes. (Instead, I'd want to find the original message at the top of the "Recent Input Messages" list after clicking the "Template Histories" button, or even have it pre-filled into the edit-boxes at this point.)
  • After making sure the original message is restored, choose "Commit (Edit)" from the dropdown next to the "Continue" button.
  • Finally, choose "Continue" to finish (or proceed with) the Rebase.

Done. You can download the latest CI build from Github Action.