git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] rebase: broken behavior with --keep-empty
@ 2015-11-20 12:04 Patrick Steinhardt
  2015-11-20 12:04 ` [PATCH 1/2] rebase: test " Patrick Steinhardt
  2015-11-20 12:04 ` [PATCH 2/2] rebase: fix preserving commits " Patrick Steinhardt
  0 siblings, 2 replies; 5+ messages in thread
From: Patrick Steinhardt @ 2015-11-20 12:04 UTC (permalink / raw)
  To: git; +Cc: ps

I've recently run into broken behavior with `git-rebase` and
`--keep-empty`. As soon as `--keep-empty` is specified, we fall
back on using `git cherry-pick` instead of `git am` for rebasing
the commits, which seems to not work correctly.

In fact I guess there are two different bugs in here. The first
bug is in using `git cherry-pick --allow-empty` instead of `git
cherry-pick --keep-redundant-commits`, as judging from
git-rebase(1) we also want to keep commits that are already
included in the branch that is being rebased upon whe we use
`--keep-empty`.

The second bug is that we fail to correctly record the
rebasing-state when using cherry-pick. This causes us to end up
in cherry-picking mode as soon as the invoked cherry-pick command
runs into any error (e.g. due to a conflict or the broken
behavior with `--allow-empty`). There is also no possibility to
get back into rebase-mode from here.

I've written two tests that document these breakages, as well as
a fix to the first described breakage. I did not fix the second
breakage of not recording rebase-state, though, as this is
somewhat more involved.

Patrick

Patrick Steinhardt (2):
  rebase: test broken behavior with --keep-empty
  rebase: fix preserving commits with --keep-empty

 git-rebase--am.sh |  2 +-
 t/t3400-rebase.sh | 26 ++++++++++++++++++++++++++
 2 files changed, 27 insertions(+), 1 deletion(-)

-- 
2.6.3

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-12-14 15:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-20 12:04 [PATCH 0/2] rebase: broken behavior with --keep-empty Patrick Steinhardt
2015-11-20 12:04 ` [PATCH 1/2] rebase: test " Patrick Steinhardt
2015-11-20 12:04 ` [PATCH 2/2] rebase: fix preserving commits " Patrick Steinhardt
2015-12-10 22:58   ` Michael Blume
2015-12-14 15:39     ` Patrick Steinhardt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).