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

Re: git rebase -f --autosquash

From
Vincent van Ravesteijn <vfr@lyx.org>
Date
May 26, 2012, 12:53 UTC
Message-ID
<4FC0D246.2010701@lyx.org>
In-Reply-To
<33DF11B90FEF4CB6B4103BE0AAF9B256@gmail.com>
Op 26-5-2012 9:30, Andy Kitchen schreef:
Show 18 quoted lines
> On Tuesday, 15 May 2012 at 2:35 AM, Junio C Hamano wrote:
>> Given "EDITOR=: git commit args..." and "EDITOR=: git merge args..." are
>> equivalent to giving "--no-edit" option to these commands, I would imagine
>> "git rebase opts... --no-editor args..." would not be such a stretch.
> I agree. However, I think it would be more intuitive to make --autosquash
> work with -f or even just on its own in non-interactive mode.
> It definitely makes sense practically and semantically to autosquash
> non-interactively. Otherwise one needs to activate interactive mode
> and effectively disable it in the same command which is a bit esoteric.
> ...
> In summary, I propose:
>
> 1a)
>
> $ git rebase -f --autosquash<base>
> is made to be effectively equivalent to:
> $ EDITOR=: git rebase -i --autosquash<base>
>
I think the following one-line patch will effectively do what you want.
diff --git a/git-rebase.sh b/git-rebase.sh
index 24a2840..c4ffdcd 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -228,8 +228,9 @@ do
      -p)
          preserve_merges=t
          test -z "$interactive_rebase" && interactive_rebase=implied
          ;;
      --autosquash)
          autosquash=t
+        test -z "$interactive_rebase" && interactive_rebase=implied
          ;;
      --no-autosquash)


Vincent
Previous: Andy KitchenNext: Junio C Hamano
Message 5 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.