git rebase interactive does not respect merge options

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]