Thread (3 messages) flat view 3 messages, 3 authors, 2016-06-15

Re: git rebase -f --autosquash

From: Vincent van Ravesteijn <hidden>
Date: 2016-06-15 22:53:55
Subsystem: the rest · Maintainer: Linus Torvalds

Possibly related (same subject, not in this thread)

Op 26-5-2012 9:30, Andy Kitchen schreef:
On Tuesday, 15 May 2012 at 2:35 AM, Junio C Hamano wrote:
quoted
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help