* Supporting --no-edit for git rebase --continue
@ 2024-02-07 20:46 Orgad Shaneh
2024-02-09 1:38 ` brian m. carlson
2024-02-09 16:16 ` Phillip Wood
0 siblings, 2 replies; 4+ messages in thread
From: Orgad Shaneh @ 2024-02-07 20:46 UTC (permalink / raw)
To: git
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Supporting --no-edit for git rebase --continue
2024-02-07 20:46 Supporting --no-edit for git rebase --continue Orgad Shaneh
@ 2024-02-09 1:38 ` brian m. carlson
2024-02-09 13:35 ` Orgad Shaneh
2024-02-09 16:16 ` Phillip Wood
1 sibling, 1 reply; 4+ messages in thread
From: brian m. carlson @ 2024-02-09 1:38 UTC (permalink / raw)
To: Orgad Shaneh; +Cc: git
[-- Attachment #1: Type: text/plain, Size: 892 bytes --]
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
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 262 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Supporting --no-edit for git rebase --continue
2024-02-09 1:38 ` brian m. carlson
@ 2024-02-09 13:35 ` Orgad Shaneh
0 siblings, 0 replies; 4+ messages in thread
From: Orgad Shaneh @ 2024-02-09 13:35 UTC (permalink / raw)
To: brian m. carlson, Orgad Shaneh, git
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Supporting --no-edit for git rebase --continue
2024-02-07 20:46 Supporting --no-edit for git rebase --continue Orgad Shaneh
2024-02-09 1:38 ` brian m. carlson
@ 2024-02-09 16:16 ` Phillip Wood
1 sibling, 0 replies; 4+ messages in thread
From: Phillip Wood @ 2024-02-09 16:16 UTC (permalink / raw)
To: Orgad Shaneh, git; +Cc: brian m . carlson
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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-02-09 16:16 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-07 20:46 Supporting --no-edit for git rebase --continue Orgad Shaneh
2024-02-09 1:38 ` brian m. carlson
2024-02-09 13:35 ` Orgad Shaneh
2024-02-09 16:16 ` Phillip Wood
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox