# Supporting --no-edit for git rebase --continue

4 messages from 2024-02-07 to 2024-02-09. Participants: Orgad Shaneh, brian m. carlson, Phillip Wood.
Thread: https://gitlist.dev/t/60868

## Orgad Shaneh, 2024-02-07 20:46

Subject: Supporting --no-edit for git rebase --continue
Message-ID: <CAGHpTB+mCxvzJ4LDpQrMgHmzigUzcAnRcwMewV0oYKM2HwbNXw@mail.gmail.com>
URL: https://gitlist.dev/e/CAGHpTB%2BmCxvzJ4LDpQrMgHmzigUzcAnRcwMewV0oYKM2HwbNXw%40mail.gmail.com

```
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.

Thanks,
- Orgad

```

## brian m. carlson, 2024-02-09 01:38

Subject: Re: Supporting --no-edit for git rebase --continue
Message-ID: <ZcWCDEnmv97orQyY@tapette.crustytoothpaste.net>
URL: https://gitlist.dev/e/ZcWCDEnmv97orQyY%40tapette.crustytoothpaste.net
In-Reply-To: <CAGHpTB+mCxvzJ4LDpQrMgHmzigUzcAnRcwMewV0oYKM2HwbNXw@mail.gmail.com>

```
On 2024-02-07 at 20:46:16, Orgad Shaneh wrote:
> 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?

I haven't checked whether this is actually possible, but I imagine it is
with some work.  I think it would be a valuable feature to add, but I
don't think anyone's planning on working on it.  Would you be willing to
send a patch?  Even if many people think it's a good idea, we're all
busy, and thus it'll only be implemented if someone is willing to pick
it up.

In the meantime, you could try setting `GIT_EDITOR=:` in your
environment (for example, using an alias) like so:

[alias]
  rncontinue = "!f() { GIT_EDITOR=: git rebase --continue; };f"

and that can serve as a workaround.
-- 
brian m. carlson (he/him or they/them)
Toronto, Ontario, CA

```

## Orgad Shaneh, 2024-02-09 13:35

Subject: Re: Supporting --no-edit for git rebase --continue
Message-ID: <CAGHpTB+_yo24d5wtTnxCHF+i+wLCiq3XjjpmaX1Z=AOxFjx+mQ@mail.gmail.com>
URL: https://gitlist.dev/e/CAGHpTB%2B_yo24d5wtTnxCHF%2Bi%2BwLCiq3XjjpmaX1Z%3DAOxFjx%2BmQ%40mail.gmail.com
In-Reply-To: <ZcWCDEnmv97orQyY@tapette.crustytoothpaste.net>

```
On Fri, Feb 9, 2024 at 3:38 AM brian m. carlson
<sandals@crustytoothpaste.net> wrote:
>
> On 2024-02-07 at 20:46:16, Orgad Shaneh wrote:
> > 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?
>
> I haven't checked whether this is actually possible, but I imagine it is
> with some work.  I think it would be a valuable feature to add, but I
> don't think anyone's planning on working on it.  Would you be willing to
> send a patch?  Even if many people think it's a good idea, we're all
> busy, and thus it'll only be implemented if someone is willing to pick
> it up.

Thank you. I'll try to prepare a patch.

> In the meantime, you could try setting `GIT_EDITOR=:` in your
> environment (for example, using an alias) like so:
>
> [alias]
>   rncontinue = "!f() { GIT_EDITOR=: git rebase --continue; };f"
>
> and that can serve as a workaround.

Nice, thanks!

- Orgad

```

## Phillip Wood, 2024-02-09 16:16

Subject: Re: Supporting --no-edit for git rebase --continue
Message-ID: <fbf859ca-43f4-433e-b111-377aa60f1947@gmail.com>
URL: https://gitlist.dev/e/fbf859ca-43f4-433e-b111-377aa60f1947%40gmail.com
In-Reply-To: <CAGHpTB+mCxvzJ4LDpQrMgHmzigUzcAnRcwMewV0oYKM2HwbNXw@mail.gmail.com>

```
Hi Orgad

On 07/02/2024 20:46, Orgad Shaneh wrote:
> 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

```
