Allow empty commits to be rebased

From: Mihai Rusu <hidden>
Date: 2016-06-15 22:50:17

Hi

When trying to rebase empty Git commits (git commit --allow-empty),
"git rebase" (and "git rebase -i") just skip the empty commits. This
may make some sense in the context of "git rebase" trying to determine
if the code to be rebased already exists in "upstream" but in our case
we need to rebase purely because of parent changes. Playing with "git
rebase", the only way to force it to rebase empty commits was to do
something like:
$ git rebase -i --onto upstream HEAD~N # where N is the number of
commits we want rebased

And then for every empty commit it stops as if it got a conflict, I
have to issue git commit --allow-empty and then git rebase --continue
(if I just run git rebase --continue as I should it skips the empty
commit). If I drop "-i" or if I don't use the onto/HEAD~N trick I'm
not able to rebase empty commits.

If you don't think that "git rebase" should support rebasing of empty
commits by default then please consider adding an --allow-empty
argument to enable such functionality.

Thanks!

-- 
Mihai Rusu
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help