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

Re: git rebase -f --autosquash

From
Junio C Hamano <gitster@pobox.com>
Date
May 27, 2012, 06:44 UTC
Message-ID
<7vobpap1gb.fsf@alter.siamese.dyndns.org>
In-Reply-To
<33DF11B90FEF4CB6B4103BE0AAF9B256@gmail.com>
Andy Kitchen <kitchen.andy@gmail.com> writes:
Show 5 quoted lines
> 1a)
>
> $ git rebase -f --autosquash <base>
> is made to be effectively equivalent to:
> $ EDITOR=: git rebase -i --autosquash <base>

I am not sure how you do the above without breaking the existing users and other people's use cases, given that giving --force option to rebase has totally different meaning from the above (i.e. "do not refuse to rebase even though the current branch is up to date with respect to <base>"). Such an option overloading, especially for an option "force", feels adding confusion without much merit---it is unclear what kind of "forcing" is it calling for.

Show 5 quoted lines
> 1b)
>
> $ git rebase --autosquash <base>
> (i.e. -f is implicit) is made to be effectively equivalent to:
> $ EDITOR=: git rebase -i --autosquash <base>
I do not think this would work.  

The --autosquash option is merely a way to help reordering by moving the "fixup!" commits in the history around without manual action You may have commits created with "fix" but _other_ commits in the history that you want to manually reorder in the insn sheet.

Show 5 quoted lines
> 3) A new command is created, for example one of:
>
> $ git fix
> $ git squash
> $ git autosquash

All of these names are so broad and generic---I am not sure if any of them will "click" with your single narrow use case, which as far as I can see is "I want rebase with --autosquash but I am not going to do any other editing." None of the above three words hints the new command is about rebasing.

Even though I find the "I want rebase with --autosquash but I am not going to do any other editing." is a workflow element that often appears in the real life, I do not think it deserves its own command that is separate from "rebase". It is merely a slightly different way to drive "rebase", after all.

And that "I want rebase with --autosquash but I am not going to do any other editing" is where my suggestion to use "--no-edit" comes from.

Previous: Vincent van RavesteijnNext: Phil Hord
Message 6 of 8 in “git rebase -f --autosquash”
  1. Andy KitchenMay 12, 2012
  2. Carlos Martín NietoMay 12, 2012
  3. Junio C HamanoMay 14, 2012
  4. Andy KitchenMay 26, 2012
  5. Vincent van RavesteijnMay 26, 2012
  6. Junio C HamanoMay 27, 2012
  7. Phil HordJun 4, 2012
  8. Junio C HamanoJun 4, 2012

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.