Thread (1 message) 1 message, 1 author, 2018-08-07

Re: [PATCH v2 0/4] fix "rebase -i --root" corrupting root commit

From: Junio C Hamano <hidden>
Date: 2018-08-07 21:09:45

Eric Sunshine [off-list ref] writes:
On Mon, Aug 6, 2018 at 9:20 PM Hilco Wijbenga [off-list ref] wrote:
quoted
But your suggestion did make me think about what behaviour I would
like to see, exactly. I like that Git removes commits that no longer
serve any purpose (because I've included their changes in earlier
commits). So I would not want to keep commits that become empty during
the rebase. What I would like to see is that commits that _start out_
as empty, are retained. Would such behaviour make sense? Or would that
be considered surprising behaviour?
I, personally, have no opinion since I don't use empty commits.
Perhaps someone more experienced and more long-sighted will chime in.
0661e49a ("git-rebase.txt: document behavioral differences between
modes", 2018-06-27) added the following.  In short, "rebase -i"
should already behave that way.

+ * empty commits:
+
+    am-based rebase will drop any "empty" commits, whether the
+    commit started empty (had no changes relative to its parent to
+    start with) or ended empty (all changes were already applied
+    upstream in other commits).
+
+    merge-based rebase does the same.
+
+    interactive-based rebase will by default drop commits that
+    started empty and halt if it hits a commit that ended up empty.
+    The `--keep-empty` option exists for interactive rebases to allow
+    it to keep commits that started empty.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help