git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mathieu Boespflug <mboes@tweag.net>
To: git@vger.kernel.org
Subject: git rebase interactive does not respect merge options
Date: Wed, 25 Apr 2012 12:53:10 -0400	[thread overview]
Message-ID: <20120425165310.GA4806@santiago> (raw)

Hi,

I have the following issue with git rebase -i: it does not seem to
respect any merge options that I pass it.

Say I'm in the following scenario. I made a bunch of commits in master,
and I would like to interactively rebase these commits on top of
origin/master. Say I want to drop a few commits that introduced only
whitespace changes. Dropping these commits might cause conflicts during
rebasing of later commits, because these later commits might affect the
same lines than the ones that were affected by the whitespace change.
Now, to avoid having to resolve these conflicts by hand, I would expect
to be able to

$ git rebase -X ignore-space-change -i origin/master

According to git-rebase(1), passing -X implies --merge and
--strategy=recursive. But these flags seem to be ignored, even if
passed explicitly. Likewise, if I specify

$ git rebase -X ours -i origin/master

or

$ git rebase -X theirs -i origin/master

I still get conflicts, which I have to resolve by hand. Passing -p makes
no difference either.

A cursory look through the source of /usr/lib/git-core/git-rebase
suggests to me git-rebase forks to either git-rebase--merge or
git-rebase--interactive to do much of the work, the two being mutually
exclusive. If this is the case, shouldn't the documentation at least
reflect that one has to pass either --interactive or --merge on the
command line, but the two together won't work?

I submit, however, that being able to specify a merge strategy during
interactive rebasing is terribly useful. Not being able to do means that
to drop commits without having to resolve conflicts by hand I have to do
split my rebasing into chunks of non-interactive

$ git rebase -s <strategy> -X <strategy-option> --onto <newbase> <upstream>

... which is significantly more cumbersome.

Thanks,

-- Mathieu

                 reply	other threads:[~2012-04-25 16:53 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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

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

  git send-email \
    --in-reply-to=20120425165310.GA4806@santiago \
    --to=mboes@tweag.net \
    --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.
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).