KEMBAR78
merge: add GIT_MERGE_TREE_FAIL_ON_CONFLICT by ethomson · Pull Request #3482 · libgit2/libgit2 · GitHub
Skip to content

Conversation

@ethomson
Copy link
Member

Provide a new merge option, GIT_MERGE_TREE_FAIL_ON_CONFLICT, which
will stop on the first conflict and fail the merge operation with
GIT_EMERGECONFLICT.

@ethomson
Copy link
Member Author

I had initially implemented this as an integer count - if we hit x conflicts, then we would fail. But that seemed really dumb and everybody would either set this to 0 or 1, so I settled on this instead. Let me know if you disagree.

/cc @vmg

Copy link
Member

Choose a reason for hiding this comment

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

Odd alignment, did you use a tab instead of spaces here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, thanks; fixed.

Provide a new merge option, GIT_MERGE_TREE_FAIL_ON_CONFLICT, which
will stop on the first conflict and fail the merge operation with
GIT_EMERGECONFLICT.
@ethomson ethomson force-pushed the merge_fail_on_conflict branch from 16d4aeb to 8683d31 Compare October 22, 2015 18:55
Copy link
Member

Choose a reason for hiding this comment

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

Would this change (and the equivalent below) make the other users of merge_trees_from_branches() and _commits_ to stop making sure that the merge succeeded? Other users should be changed to wrap their call in cl_git_pass() since we don't anymore, no?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, sorry that's subtle. Other users had already been asserting success here (wrapping their calls in cl_git_pass). That was sort of silly as those calls could never fail, but there it is.

Copy link
Member

Choose a reason for hiding this comment

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

Ok, just wanted to make sure this ramification had been considered.

@vmg
Copy link
Member

vmg commented Oct 23, 2015

You're an 👼 @ethomson

vmg pushed a commit that referenced this pull request Oct 23, 2015
merge: add GIT_MERGE_TREE_FAIL_ON_CONFLICT
@vmg vmg merged commit 7c0c21c into libgit2:master Oct 23, 2015
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