summaryrefslogtreecommitdiff
path: root/builtin/rebase.c
diff options
context:
space:
mode:
authorLibravatar Pratik Karki <predatoramigo@gmail.com>2018-08-08 21:21:34 +0545
committerLibravatar Junio C Hamano <gitster@pobox.com>2018-10-11 14:16:05 +0900
commit3dba9d08842226483c2d146e6dd37a6bfd27914e (patch)
treea1937bee1569a0b78de061191550a6e155844ee6 /builtin/rebase.c
parentbuiltin rebase: show progress when connected to a terminal (diff)
downloadtgif-3dba9d08842226483c2d146e6dd37a6bfd27914e.tar.xz
builtin rebase: use no-op editor when interactive is "implied"
Some options are only handled by the git-rebase--interactive backend, even if run non-interactively. For this awkward situation (run non-interactively, but use the interactive backend), the shell scripted version of `git rebase` introduced the concept of an "implied interactive rebase". All it does is to replace the editor by a dummy one (`:` is the Unix command that takes arbitrary command-line parameters, ignores them and simply exits with success). Signed-off-by: Pratik Karki <predatoramigo@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/rebase.c')
-rw-r--r--builtin/rebase.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/builtin/rebase.c b/builtin/rebase.c
index 600788bf72..36d311b42f 100644
--- a/builtin/rebase.c
+++ b/builtin/rebase.c
@@ -383,6 +383,13 @@ static int run_specific_rebase(struct rebase_options *opts)
add_var(&script_snippet, "git_format_patch_opt",
opts->git_format_patch_opt.buf);
+ if (is_interactive(opts) &&
+ !(opts->flags & REBASE_INTERACTIVE_EXPLICIT)) {
+ strbuf_addstr(&script_snippet,
+ "GIT_EDITOR=:; export GIT_EDITOR; ");
+ opts->autosquash = 0;
+ }
+
switch (opts->type) {
case REBASE_AM:
backend = "git-rebase--am";