Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--goal='rebase' is not yet supported for branches that include merges. #151

Open
abitrolly opened this issue Jun 16, 2020 · 3 comments
Open

Comments

@abitrolly
Copy link
Contributor

I am trying to rebase this PR RHVoice/RHVoice#21 and the latest git-imerge rebase reports this status.

The following commits on the to-be-merged branch are merge commits:
    7702e778199fd58dfc7235cfef2140fb98fdedd7
    5ac10c5663ceb46c2ef571269f3a510a99bb6862
    1d66d788ddbcd875a59b6d30e48a057d500429ca
    3d6ca307c990b02960f9e32ec8b530a6dbd5a184
    a59e0ce4e47d2a83c35f92013bebdf088dcfa276
--goal='rebase' is not yet supported for branches that include merges.

Are there any manual workaround against this problem?

abitrolly added a commit to abitrolly/git-imerge that referenced this issue Jun 16, 2020
@abitrolly
Copy link
Contributor Author

I found that I can remove merge commits by rebasing on top of their parent in parent branch. For example the commit 7702e.. above has two parents.

$ git log --pretty=%P -1 7702e | cat
fbf8485c51c9b60dd8eb8dd1ea33a7575ab000bc b1c69ab76842915b67ba88a3787bbba81bebdea4

The fbf84.. is from my branch that I am trying to rebase and b1c69.. is from master. I don't know how to detect commits from the other branch automatically.

Now I could probably remove the merge commit by rebasing on top of it. But it didn't work.

$ git rebase b1c69
CONFLICT (modify/delete): README deleted in HEAD and modified in 5498a1d... README: Fix link to downloads. Version 5498a1d... README: Fix link to downloads of README left in tree.
error: could not apply 5498a1d... README: Fix link to downloads
Resolve all conflicts manually, mark them as resolved with
"git add/rm <conflicted_files>", then run "git rebase --continue".
You can instead skip this commit: run "git rebase --skip".
To abort and get back to the state before "git rebase", run "git rebase --abort".
Could not apply 5498a1d... README: Fix link to downloads

For some reason git rebase keeps comparing with HEAD instead of b1c69 where README is not touched - RHVoice/RHVoice@7702e77

@mhagger
Copy link
Owner

mhagger commented Jun 16, 2020

As a branch gets more complicated, it quickly becomes unclear what it even means to rebase it. It depends on what branch was merged into your branch. Should that branch also be rebased? What if it sprouts from an earlier point on your own branch? What if it sprouts from an earlier or later commit on the target branch?

I've occasionally done such transformations by hand, for example redoing the sub-branch merge as a rebase, then rebasing the main branch on top of that, etc. But it's very easy to get confused and end up with nonsense.

That's why I'm skeptical about the wisdom of removing this limitation, at least in the general case.

@abitrolly
Copy link
Contributor Author

Is there a command to get the branching structure of DAG without commits with single parent and child that don't participate in branching?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants