summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Documentation/git-rebase.txt3
-rw-r--r--sequencer.c5
2 files changed, 7 insertions, 1 deletions
diff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt
index f7a6033607..8ab0558aca 100644
--- a/Documentation/git-rebase.txt
+++ b/Documentation/git-rebase.txt
@@ -620,7 +620,8 @@ commits that started empty, though these are rare in practice. It
also drops commits that become empty and has no option for controlling
this behavior.
-The merge backend keeps intentionally empty commits. Similar to the
+The merge backend keeps intentionally empty commits (though with -i
+they are marked as empty in the todo list editor). Similar to the
apply backend, by default the merge backend drops commits that become
empty unless -i/--interactive is specified (in which case it stops and
asks the user what to do). The merge backend also has an
diff --git a/sequencer.c b/sequencer.c
index e528225e78..ce9fd27a87 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -4656,6 +4656,9 @@ static int make_script_with_merges(struct pretty_print_context *pp,
strbuf_addf(&buf, "%s %s %s", cmd_pick,
oid_to_hex(&commit->object.oid),
oneline.buf);
+ if (is_empty)
+ strbuf_addf(&buf, " %c empty",
+ comment_line_char);
FLEX_ALLOC_STR(entry, string, buf.buf);
oidcpy(&entry->entry.oid, &commit->object.oid);
@@ -4861,6 +4864,8 @@ int sequencer_make_script(struct repository *r, struct strbuf *out, int argc,
strbuf_addf(out, "%s %s ", insn,
oid_to_hex(&commit->object.oid));
pretty_print_commit(&pp, commit, out);
+ if (is_empty)
+ strbuf_addf(out, " %c empty", comment_line_char);
strbuf_addch(out, '\n');
}
return 0;