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

prettier-diff as a git merge driver #3

Open
snoblenet opened this issue Sep 22, 2018 · 3 comments
Open

prettier-diff as a git merge driver #3

snoblenet opened this issue Sep 22, 2018 · 3 comments

Comments

@snoblenet
Copy link

Have you considered extending this project so it can be used as a git merge driver?

@josephfrazier
Copy link
Owner

Hey, this sounds like a cool idea! I'm not too familiar with merge drivers though, can you describe the type of situation this would help with?

@snoblenet
Copy link
Author

Sure. Because Git's built in diff/merge/rebase strategies work on a line-by-line basis, not function-by-function or expression-by-expression, the merge conflict markers that it generates are at the start and end of the smallest number of lines that can be grouped together to a show a change, rather than at the end of each affected function or expression. This can make resolving merge conflicts very difficult, especially when there are many levels of nesting in the syntax.

@josephfrazier
Copy link
Owner

Hmm, I can see how this would be useful for projects that use Prettier, but accept contributions which may not already be formatted with Prettier. Not sure how feasible it would be to support non-Prettier projects though.

Even if the merge driver isn't implemented, the same effect could be achieved by running Prettier on both branches before merging them, right?

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