git/list[1] front-page[2] threads[3] people[4] search[5] about
 

git rebase interactive does not respect merge options

From
MBMathieu Boespflug <mboes@tweag.net>
Date
Apr 25, 2012, 16:53 UTC
Message-ID
<20120425165310.GA4806@santiago>
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
Message 1 of 1 in “git rebase interactive does not respect merge options”
  1. Mathieu BoespflugApr 25, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.