git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Patrick Steinhardt <ps@pks.im>
To: git@vger.kernel.org
Cc: ps@pks.im
Subject: [PATCH 0/2] rebase: broken behavior with --keep-empty
Date: Fri, 20 Nov 2015 13:04:38 +0100	[thread overview]
Message-ID: <1448021080-4994-1-git-send-email-ps@pks.im> (raw)

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

             reply	other threads:[~2015-11-20 12:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-20 12:04 Patrick Steinhardt [this message]
2015-11-20 12:04 ` [PATCH 1/2] rebase: test broken behavior with --keep-empty 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1448021080-4994-1-git-send-email-ps@pks.im \
    --to=ps@pks.im \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).