git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] rebase -i: only automatically amend commit if HEAD did not change

From
Avery Pennarun <apenwarr@gmail.com>
Date
Jul 23, 2008, 15:53 UTC
Message-ID
<32541b130807230853y136f41bdmf221637e35d601c3@mail.gmail.com>
In-Reply-To
<20080723120104.GQ2925@dpotapov.dyndns.org>
On 7/23/08, Dmitry Potapov <dpotapov@gmail.com> wrote:
Show 12 quoted lines
> On Tue, Jul 22, 2008 at 06:22:34PM -0400, Avery Pennarun wrote:
>  > This patch is perhaps a symptom of something I've been meaning to ask
>  > about for a while.
>  >
>  > Why doesn't "edit" just stage the commit and not auto-commit it at
>  > all?  That way an amend would *never* be necessary, and rebase
>  > --continue would always do a commit -a (if there was anything left to
>  > commit).
>
> Actually, it would be better to refuse to continue if there are unstaged
>  changes in the work tree, and if all changes are staged then just do git
> commit.

I'm not sure about that. The auto-committing on --continue has never annoyed me, and in fact I greatly appreciate that I can just "git rebase --continue" after making changes and the expected thing will happen. After all, if I screw it up and commit too much at once, I can always just rebase one more time.

However, taking out the auto-commit wouldn't pain me too much if others want it that way. It would be somewhat more typing, but at least makes easy to understand exactly what's going on.

> It would not only save typing, but also help to avoid costly mistakes
>  where users, being taught to use "git commit --amend" after editing
>  during git-rebase, fire this command automatically after a conflict
>  resolution and get two commits accidently squashed.

Yes! Good point. I forgot about this, but I've been bitten by it a couple of times.

Have fun,
Avery
Previous: Dmitry PotapovNext: Johannes Schindelin
Message 7 of 14 in “rebase -i: only automatically amend commit if HEAD did not change”
  1. rebase -i: only automatically amend commit if HEAD did not changeJohannes Schindelin, Jul 22, 2008
  2. Stephan BeyerJul 22, 2008
  3. Avery PennarunJul 22, 2008
  4. Junio C HamanoJul 22, 2008
  5. Avery PennarunJul 23, 2008
  6. Dmitry PotapovJul 23, 2008
  7. Avery PennarunJul 23, 2008
  8. Johannes SchindelinJul 23, 2008
  9. Avery PennarunJul 23, 2008
  10. Junio C HamanoJul 23, 2008
  11. Johannes SchindelinJul 24, 2008
  12. Stephan BeyerJul 24, 2008
  13. Junio C HamanoJul 25, 2008
  14. Johannes SchindelinJul 25, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.