git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Failure and unhelpful error message from 'rebase --preserve-merges'
       [not found] <50ED63CB.7060108@cisco.com>
@ 2013-01-09 13:19 ` Phil Hord
  0 siblings, 0 replies; only message in thread
From: Phil Hord @ 2013-01-09 13:19 UTC (permalink / raw)
  To: git@vger.kernel.org; +Cc: Neil Horman, Martin von Zweigbergk

Since 90e1818f9a  (git-rebase: add keep_empty flag, 2012-04-20)
'git rebase --preserve-merges' fails in a case where it used to
succeed, and it does so with an unhelpful error message.

   $ git rebase --preserve-merges master
   error: Commit 452524... is a merge but no -m option was given.
   fatal: cherry-pick failed
   Could not pick 452524f925aecd0439ae5728fca3887292114dd7

I also tried rebase with '-m'
   $ git rebase --preserve-merges -m master
but that also failed.

The same commands worked fine for these same commits in v1.7.9

>From 90e1818f9a I figured out that the rebase-interactive
machinery had dropped one of my merges. I normally would not
notice this when using 'git rebase -p' since it does not invoke $EDITOR
by default; but I can see it if I use this:

   git -c sequence.editor=cat rebase -p master

With that I see my list of commits, including these:

  ...
  pick 184ec4d WIP: DHCP datastore reporting
  # pick 16ca56c Merge ptss into sock-threads
  pick 06aea55 WIP: More work normalizing config handlers
  ...
  pick 452524f Merge branch 'ptss' into sock-threads
  ...
  #
  # Note that empty commits are commented out

The failure points to the 2nd merge commit, but it is not the merge
commit which was commented out. It is a later merge between the same two
branches. I'm not sure how this is related, yet.

But I now know I can work around the problem with this:

    git rebase --keep-empty -p master

I see three problems here, but I don't have any time to go fix them
myself right now.

 1. 'rebase -p' should default to --keep-empty since the user will not
    be given the opportunity to edit the list to uncomment the missing
    commits.

 2. 'rebase --interactive -p' should not drop empty merge commits.

 3. rebase should not die with a cryptic cherry-pick error message,
    although I am not sure what useful thing it could say in this
    particular case. Maybe there are other conditions which will cause
    this same failure even if 1 and 2 are fixed.

Phil

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-01-09 13:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <50ED63CB.7060108@cisco.com>
2013-01-09 13:19 ` Failure and unhelpful error message from 'rebase --preserve-merges' Phil Hord

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).