Re: Supporting --no-edit for git rebase --continue
- From
- Phillip Wood <phillip.wood123@gmail.com>
- Date
- Feb 9, 2024, 16:16 UTC
- Message-ID
- <fbf859ca-43f4-433e-b111-377aa60f1947@gmail.com>
- In-Reply-To
- <CAGHpTB+mCxvzJ4LDpQrMgHmzigUzcAnRcwMewV0oYKM2HwbNXw@mail.gmail.com>
Hi Orgad
On 07/02/2024 20:46, Orgad Shaneh wrote:
Show 8 quoted lines
> Hi, > > Is it possible to add --no-edit for git rebase --continue, similar to > the functionality of this flag for git cherry-pick --continue and > similar commands? > > This should continue the rebase without activating the commit message > editor, and just keep the existing message.
I think being able to say "git rebase --continue --no-edit" to stop rebase prompting for a commit message when resolving a conflict would be useful but it would need to be careful that it did not suppress the editor for "reword", "squash", or "fixup" commands. You can use an alias that only runs the editor if HEAD has changed since the rebase was continued to do this
git config alias.rbc-no-edit '!
no_edit_head=$(git show-ref -s --verify HEAD) &&
real_editor="$(git var GIT_EDITOR)" &&
GIT_EDITOR="test \"\$(git show-ref -s --verify HEAD)\" = \"$no_edit_head\" || \
$real_editor" git rebase --continue'Best Wishes
Phillip