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

provide a git merge driver #896

Open
graingert opened this issue Jun 20, 2019 · 3 comments
Open

provide a git merge driver #896

graingert opened this issue Jun 20, 2019 · 3 comments
Labels
C: integrations Editor plugins and other integrations

Comments

@graingert
Copy link
Contributor

Provide a merge driver tool similar to clang_format_merge_driver to allow easier merge conflict resolution when merging non-blackened branches into a blackened branch

https://chromium.googlesource.com/chromium/tools/depot_tools.git/+/refs/heads/master/clang_format_merge_driver.py

@zsol zsol added the C: integrations Editor plugins and other integrations label Jun 23, 2019
@max-sixty
Copy link

Does anyone have any advice for projects that are rolling this out, specifically to make it easy for existing PRs to merge? We're planning on rolling this out in xarray and looking to ease the transition.

Off the top of my head I'm thinking we can ask existing PRs to:

  • Merge master prior to the black commit (any conflicts are real conflicts and require resolving)
  • Apply black . to this branch
  • Merge master at the black commit, resolving in favor of our changes: git merge [black-commit] -X ours
  • Merge current master, again resolving any conflicts

@zsol
Copy link
Collaborator

zsol commented Jul 23, 2019

I generally recommend the second approach (apply black to the PR before merging), it works well

@max-sixty
Copy link

I had meant those as a list of steps, rather than options.
My experience is that only running black on a feature branch creates a bunch of conflicts on merging in a master with black previously applied.
I just attempted on a test feature branch, and it did create conflicts. I think that makes sense - both parents have changes over the lines of the feature branch (assuming the feature branch has edits to existing lines).

Am I missing something?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: integrations Editor plugins and other integrations
Projects
None yet
Development

No branches or pull requests

3 participants