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

Use three-way diffs for merge conflicts #45

Merged
merged 2 commits into from
Dec 5, 2023
Merged

Conversation

robmoss
Copy link
Owner

@robmoss robmoss commented Dec 18, 2022

As part of the initial setup instructions, we now set the merge-conflict style to 'diff3', which also shows the original lines. This extra information can help to decide how to best resolve a conflict.

In the first example conflict, it changes the diff from:

diff --cc test.txt
index 18712c4,bc576a6..0000000
--- a/test.txt
+++ b/test.txt
@@@ -1,3 -1,3 +1,7 @@@
  First line
++<<<<<<< ours
 +A different second line
++=======
+ My new second line
++>>>>>>> theirs
  Third line

to:

diff --cc test.txt
index 18712c4,bc576a6..0000000
--- a/test.txt
+++ b/test.txt
@@@ -1,3 -1,3 +1,7 @@@
  First line
++<<<<<<< ours
 +A different second line
++||||||| base
++Second line
++=======
+ My new second line
++>>>>>>> theirs
  Third line

The 'diff3' conflict style also shows the original lines, and this extra
information can help to decide how to best resolve a conflict.
@robmoss robmoss added the enhancement New feature or request label Dec 18, 2022
@github-actions
Copy link

github-actions bot commented Dec 18, 2022

PR Preview Action v1.4.4
Preview removed because the pull request was closed.
2023-12-05 23:57 UTC

I wanted to highlight that configuration does not have to be done at the user level.
I've included an additional info section to explain that the --local or --system could be used instead, with differing effects.
@EamonConway
Copy link
Collaborator

I have provided an additional info section for the --global flag.
I think it is important that people know they can change the configuration on a repo by repo basis.
I can confirm that this hosts locally successfully.
Happy for this to be merged if you agree.

@robmoss
Copy link
Owner Author

robmoss commented Sep 15, 2023

Very nice, thank you!

@robmoss robmoss merged commit 2345934 into master Dec 5, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants