Re: rebase -i: quick/inline reword
- From
Sergey Organov <sorganov@gmail.com>
- Date
- May 8, 2020, 21:14 UTC
- Message-ID
- <87sggab031.fsf@osv.gnss.ru>
- In-Reply-To
- <20200508000538.GE7234@camp.crustytoothpaste.net>
"brian m. carlson" <sandals@crustytoothpaste.net> writes:
Show 20 quoted lines
> On 2020-05-07 at 10:49:29, Sergey Organov wrote:
>> It'd be really nice if it were possible to, say, search&replace in, or
>> spell-check, interactively, all the commit messages (including titles)
>> of a bunch of commits to be published, all in a single file handled by
>> single rebase run.
>
> It is possible to do this with a bit of shell scripting. You can run
> "git rebase -x" if you want to check every commit in a certain way.
>
> If instead you'd like to modify all the commit messages, you can use
> something like this:
>
> GIT_SEQUENCE_EDITOR="sed -e 's/^pick /reword /'" \
> GIT_EDITOR="some-shell-script-that-modifies-its-file-argument-in-place" \
> git rebase -i BASE
>
> I use something similar as an alias to automatically squash all my
> squash and fixup commits without needing to open an editor:
>
> !f() { GIT_SEQUENCE_EDITOR=true git rebase -i --autosquash "$@"; };fThese are very good and useful features indeed, and they are examples of batch processing that is very handy for automation, but lacks interactivity. What I rather have in mind is being able to put all the messages /simultaneously/ into my favorite text editor and edit them more or less freely till I'm satisfied, then "commit" the overall result by passing it back to git. Essentially "git rebase -i" on steroids.
-- Sergey