Skip to content

Conversation

@mhagger
Copy link
Owner

@mhagger mhagger commented Jun 24, 2018

Add an option git imerge reparent --commit=COMMIT, which allows the parents of an arbitrary commit to be changed. Moreover, the descendants of COMMIT are also rewritten all the way to HEAD.

Fixes #129.

This is an alternative implementation of #130.

@make1980: does this work for you?

Add an option `git imerge reparent --commit=COMMIT`, which allows the
parents of an arbitrary commit to be changed. Moreover, the
descendants of COMMIT are also rewritten all the way to HEAD.

This feature was suggested by Ke Ma <[email protected]>, and the
implementation is partly derived from PR #130 submitted by Ke Ma.
)


def reparent_recursively(git, start_commit, parents, end_commit):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: this isn't a recursive process but rather an iterative process

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is in fact recursive; it's just that the recursion is built into git log --topo-order --reverse rather than coded explicitly here. But this is just an internal name so I don't think the distinction matters much.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sense.

@make1980-zz
Copy link

I have verified that this implementation works for our case. Please submit.

Copy link

@make1980-zz make1980-zz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified that this works well.

@mhagger mhagger merged commit 9303372 into master Jul 1, 2018
@mhagger mhagger deleted the reparent-specific-commit branch July 1, 2018 16:01
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

Successfully merging this pull request may close these issues.

3 participants