]> git.ipfire.org Git - thirdparty/git.git/blobdiff - sequencer.c
rebase -i: introduce --rebase-merges=[no-]rebase-cousins
[thirdparty/git.git] / sequencer.c
index afa155c28290ad069e0e2fef64e9447526f8c78f..e2f83942843ec5aec866d4029d26abbba0a8713f 100644 (file)
@@ -3578,6 +3578,7 @@ static int make_script_with_merges(struct pretty_print_context *pp,
                                   unsigned flags)
 {
        int keep_empty = flags & TODO_LIST_KEEP_EMPTY;
+       int rebase_cousins = flags & TODO_LIST_REBASE_COUSINS;
        struct strbuf buf = STRBUF_INIT, oneline = STRBUF_INIT;
        struct strbuf label = STRBUF_INIT;
        struct commit_list *commits = NULL, **tail = &commits, *iter;
@@ -3755,6 +3756,9 @@ static int make_script_with_merges(struct pretty_print_context *pp,
                                           &commit->object.oid);
                        if (entry)
                                to = entry->string;
+                       else if (!rebase_cousins)
+                               to = label_oid(&commit->object.oid, NULL,
+                                              &state);
 
                        if (!to || !strcmp(to, "onto"))
                                fprintf(out, "%s onto\n", cmd_reset);