# [RFC] git rebase --edit

2 messages from 2010-02-12 to 2010-02-12. Participants: Tay Ray Chuan, Johannes Schindelin.
Thread: https://gitlist.dev/t/22624

## Tay Ray Chuan, 2010-02-12 08:44

Subject: [RFC] git rebase --edit
Message-ID: <be6fef0d1002120044w5f14d061t52863fbc8b0bd304@mail.gmail.com>
URL: https://gitlist.dev/e/be6fef0d1002120044w5f14d061t52863fbc8b0bd304%40mail.gmail.com

```
Hi,

sometimes, I need to edit a commit, and I find myself doing some
rather "mechanical" steps.

  $ git log #find the commit
  $ git rebase -i <commit>^
  $ #mark <commit> with 'e', save, exit editor

  Stopped at <commit>... <commit message>
  You can amend the commit now, with
  ...

Perhaps git-rebase --interactive could learn an option, say, --edit
<commit>, that

  1. determines where to start the rebase (instead of saying <commit>^ above),
  2. marks <commit> as 'e' in git-rebase-todo,
  3. start the edit process ("You can amend the commit now...").

The user would then proceed with the usual git-rebase --continue.

Is this a workable suggestion?

-- 
Cheers,
Ray Chuan

```

## Johannes Schindelin, 2010-02-12 09:29

Subject: Re: [RFC] git rebase --edit
Message-ID: <alpine.DEB.1.00.1002121026380.20986@pacific.mpi-cbg.de>
URL: https://gitlist.dev/e/alpine.DEB.1.00.1002121026380.20986%40pacific.mpi-cbg.de
In-Reply-To: <be6fef0d1002120044w5f14d061t52863fbc8b0bd304@mail.gmail.com>

```
Hi,

On Fri, 12 Feb 2010, Tay Ray Chuan wrote:

> [description how to amend a single commit that is not HEAD]
>
> Perhaps git-rebase --interactive could learn an option, say, --edit
> <commit>, that
> 
>   1. determines where to start the rebase (instead of saying <commit>^ above),
>   2. marks <commit> as 'e' in git-rebase-todo,
>   3. start the edit process ("You can amend the commit now...").
> 
> The user would then proceed with the usual git-rebase --continue.
> 
> Is this a workable suggestion?

Sure!

Note that the current workflow for such things is to make a temporary 
commit which is then handled by the new "fixup" command. But of course, 
this only works if your history is not messy, i.e. has too many changes in 
the same place (because then the fixup commit does not apply cleanly to 
the commit in question).

Ciao,
Dscho

```
