-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Improve error output when encountering git conflict markers #115413
Closed
+137
−124
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2705,13 +2705,13 @@ impl<'a> Parser<'a> { | |
Ok(()) | ||
} | ||
|
||
pub fn is_diff_marker(&mut self, long_kind: &TokenKind, short_kind: &TokenKind) -> bool { | ||
pub fn is_conflict_marker(&mut self, long_kind: &TokenKind, short_kind: &TokenKind) -> bool { | ||
(0..3).all(|i| self.look_ahead(i, |tok| tok == long_kind)) | ||
&& self.look_ahead(3, |tok| tok == short_kind) | ||
} | ||
|
||
fn diff_marker(&mut self, long_kind: &TokenKind, short_kind: &TokenKind) -> Option<Span> { | ||
if self.is_diff_marker(long_kind, short_kind) { | ||
fn conflict_marker(&mut self, long_kind: &TokenKind, short_kind: &TokenKind) -> Option<Span> { | ||
if self.is_conflict_marker(long_kind, short_kind) { | ||
let lo = self.token.span; | ||
for _ in 0..4 { | ||
self.bump(); | ||
|
@@ -2721,8 +2721,9 @@ impl<'a> Parser<'a> { | |
None | ||
} | ||
|
||
pub fn recover_diff_marker(&mut self) { | ||
let Some(start) = self.diff_marker(&TokenKind::BinOp(token::Shl), &TokenKind::Lt) else { | ||
pub fn recover_conflict_marker(&mut self) { | ||
let Some(start) = self.conflict_marker(&TokenKind::BinOp(token::Shl), &TokenKind::Lt) | ||
else { | ||
return; | ||
}; | ||
let mut spans = Vec::with_capacity(3); | ||
|
@@ -2734,40 +2735,52 @@ impl<'a> Parser<'a> { | |
if self.token.kind == TokenKind::Eof { | ||
break; | ||
} | ||
if let Some(span) = self.diff_marker(&TokenKind::OrOr, &TokenKind::BinOp(token::Or)) { | ||
if let Some(span) = self.conflict_marker(&TokenKind::OrOr, &TokenKind::BinOp(token::Or)) | ||
{ | ||
middlediff3 = Some(span); | ||
} | ||
if let Some(span) = self.diff_marker(&TokenKind::EqEq, &TokenKind::Eq) { | ||
if let Some(span) = self.conflict_marker(&TokenKind::EqEq, &TokenKind::Eq) { | ||
middle = Some(span); | ||
} | ||
if let Some(span) = self.diff_marker(&TokenKind::BinOp(token::Shr), &TokenKind::Gt) { | ||
if let Some(span) = self.conflict_marker(&TokenKind::BinOp(token::Shr), &TokenKind::Gt) | ||
{ | ||
spans.push(span); | ||
end = Some(span); | ||
break; | ||
} | ||
self.bump(); | ||
} | ||
let mut err = self.struct_span_err(spans, "encountered diff marker"); | ||
err.span_label(start, "after this is the code before the merge"); | ||
let mut err = self.struct_span_err(spans, "encountered git conflict marker"); | ||
|
||
// with diff3 | ||
if let Some(middle) = middlediff3 { | ||
err.span_label(middle, ""); | ||
err.span_label( | ||
start, | ||
"between this marker and `|||||||` is the code that we're merging into", | ||
); | ||
err.span_label(middle, "between this marker and `=======` is the base code (what the two refs diverged from)"); | ||
} else { | ||
err.span_label( | ||
start, | ||
"between this marker and `=======` is the code that we're merging into", | ||
); | ||
} | ||
|
||
if let Some(middle) = middle { | ||
err.span_label(middle, ""); | ||
err.span_label(middle, "between this marker and `>>>>>>>` is the incoming code"); | ||
} | ||
|
||
if let Some(end) = end { | ||
err.span_label(end, "above this are the incoming code changes"); | ||
err.span_label(end, ""); | ||
} | ||
err.help( | ||
"if you're having merge conflicts after pulling new code, the top section is the code \ | ||
you already had and the bottom section is the remote code", | ||
"conflict markers indicate that a merge was started but could not be completed due to merge conflicts", | ||
); | ||
err.help( | ||
"if you're in the middle of a rebase, the top section is the code being rebased onto \ | ||
and the bottom section is the code coming from the current commit being rebased", | ||
Comment on lines
-2762
to
-2767
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm slightly concerned about removing these two notes, because I find them to be a significant part of what makes the error useful. Would you be open with adding them back in addition to the new ones? Maybe marking some as note (their title is a big less colorful). |
||
"to resolve a conflict, keep only the code you want and then delete the lines containing conflict markers", | ||
); | ||
err.note( | ||
"for an explanation on these markers from the `git` documentation, visit \ | ||
"for more information, visit the `git` documentation \ | ||
<https://git-scm.com/book/en/v2/Git-Tools-Advanced-Merging#_checking_out_conflicts>", | ||
); | ||
err.emit(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
error: encountered diff marker | ||
error: encountered git conflict marker | ||
--> $DIR/enum-2.rs:3:1 | ||
| | ||
LL | <<<<<<< HEAD | ||
| ^^^^^^^ after this is the code before the merge | ||
| ^^^^^^^ between this marker and `|||||||` is the code that we're merging into | ||
LL | x: u8, | ||
LL | ||||||| | ||
| ------- | ||
| ------- between this marker and `=======` is the base code (what the two refs diverged from) | ||
LL | z: (), | ||
LL | ======= | ||
| ------- | ||
| ------- between this marker and `>>>>>>>` is the incoming code | ||
LL | y: i8, | ||
LL | >>>>>>> branch | ||
| ^^^^^^^ above this are the incoming code changes | ||
| ^^^^^^^ | ||
| | ||
= help: if you're having merge conflicts after pulling new code, the top section is the code you already had and the bottom section is the remote code | ||
= help: if you're in the middle of a rebase, the top section is the code being rebased onto and the bottom section is the code coming from the current commit being rebased | ||
= note: for an explanation on these markers from the `git` documentation, visit <https://git-scm.com/book/en/v2/Git-Tools-Advanced-Merging#_checking_out_conflicts> | ||
= help: conflict markers indicate that a merge was started but could not be completed due to merge conflicts | ||
= help: to resolve a conflict, keep only the code you want and then delete the lines containing conflict markers | ||
= note: for more information, visit the `git` documentation <https://git-scm.com/book/en/v2/Git-Tools-Advanced-Merging#_checking_out_conflicts> | ||
|
||
error: aborting due to previous error | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
error: encountered diff marker | ||
error: encountered git conflict marker | ||
--> $DIR/enum.rs:2:1 | ||
| | ||
LL | <<<<<<< HEAD | ||
| ^^^^^^^ after this is the code before the merge | ||
| ^^^^^^^ between this marker and `=======` is the code that we're merging into | ||
LL | Foo(u8), | ||
LL | ======= | ||
| ------- | ||
| ------- between this marker and `>>>>>>>` is the incoming code | ||
LL | Bar(i8), | ||
LL | >>>>>>> branch | ||
| ^^^^^^^ above this are the incoming code changes | ||
| ^^^^^^^ | ||
| | ||
= help: if you're having merge conflicts after pulling new code, the top section is the code you already had and the bottom section is the remote code | ||
= help: if you're in the middle of a rebase, the top section is the code being rebased onto and the bottom section is the code coming from the current commit being rebased | ||
= note: for an explanation on these markers from the `git` documentation, visit <https://git-scm.com/book/en/v2/Git-Tools-Advanced-Merging#_checking_out_conflicts> | ||
= help: conflict markers indicate that a merge was started but could not be completed due to merge conflicts | ||
= help: to resolve a conflict, keep only the code you want and then delete the lines containing conflict markers | ||
= note: for more information, visit the `git` documentation <https://git-scm.com/book/en/v2/Git-Tools-Advanced-Merging#_checking_out_conflicts> | ||
|
||
error: aborting due to previous error | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
error: encountered diff marker | ||
error: encountered git conflict marker | ||
--> $DIR/fn-arg.rs:3:1 | ||
| | ||
LL | <<<<<<< HEAD | ||
| ^^^^^^^ after this is the code before the merge | ||
| ^^^^^^^ between this marker and `=======` is the code that we're merging into | ||
LL | x: u8, | ||
LL | ======= | ||
| ------- | ||
| ------- between this marker and `>>>>>>>` is the incoming code | ||
LL | x: i8, | ||
LL | >>>>>>> branch | ||
| ^^^^^^^ above this are the incoming code changes | ||
| ^^^^^^^ | ||
| | ||
= help: if you're having merge conflicts after pulling new code, the top section is the code you already had and the bottom section is the remote code | ||
= help: if you're in the middle of a rebase, the top section is the code being rebased onto and the bottom section is the code coming from the current commit being rebased | ||
= note: for an explanation on these markers from the `git` documentation, visit <https://git-scm.com/book/en/v2/Git-Tools-Advanced-Merging#_checking_out_conflicts> | ||
= help: conflict markers indicate that a merge was started but could not be completed due to merge conflicts | ||
= help: to resolve a conflict, keep only the code you want and then delete the lines containing conflict markers | ||
= note: for more information, visit the `git` documentation <https://git-scm.com/book/en/v2/Git-Tools-Advanced-Merging#_checking_out_conflicts> | ||
|
||
error: aborting due to previous error | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
error: encountered diff marker | ||
error: encountered git conflict marker | ||
--> $DIR/item-with-attr.rs:2:1 | ||
| | ||
LL | <<<<<<< HEAD | ||
| ^^^^^^^ after this is the code before the merge | ||
| ^^^^^^^ between this marker and `=======` is the code that we're merging into | ||
LL | fn foo() {} | ||
LL | ======= | ||
| ------- | ||
| ------- between this marker and `>>>>>>>` is the incoming code | ||
LL | fn bar() {} | ||
LL | >>>>>>> branch | ||
| ^^^^^^^ above this are the incoming code changes | ||
| ^^^^^^^ | ||
| | ||
= help: if you're having merge conflicts after pulling new code, the top section is the code you already had and the bottom section is the remote code | ||
= help: if you're in the middle of a rebase, the top section is the code being rebased onto and the bottom section is the code coming from the current commit being rebased | ||
= note: for an explanation on these markers from the `git` documentation, visit <https://git-scm.com/book/en/v2/Git-Tools-Advanced-Merging#_checking_out_conflicts> | ||
= help: conflict markers indicate that a merge was started but could not be completed due to merge conflicts | ||
= help: to resolve a conflict, keep only the code you want and then delete the lines containing conflict markers | ||
= note: for more information, visit the `git` documentation <https://git-scm.com/book/en/v2/Git-Tools-Advanced-Merging#_checking_out_conflicts> | ||
|
||
error: aborting due to previous error | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
error: encountered diff marker | ||
error: encountered git conflict marker | ||
--> $DIR/item.rs:1:1 | ||
| | ||
LL | <<<<<<< HEAD | ||
| ^^^^^^^ after this is the code before the merge | ||
| ^^^^^^^ between this marker and `=======` is the code that we're merging into | ||
LL | fn foo() {} | ||
LL | ======= | ||
| ------- | ||
| ------- between this marker and `>>>>>>>` is the incoming code | ||
LL | fn bar() {} | ||
LL | >>>>>>> branch | ||
| ^^^^^^^ above this are the incoming code changes | ||
| ^^^^^^^ | ||
| | ||
= help: if you're having merge conflicts after pulling new code, the top section is the code you already had and the bottom section is the remote code | ||
= help: if you're in the middle of a rebase, the top section is the code being rebased onto and the bottom section is the code coming from the current commit being rebased | ||
= note: for an explanation on these markers from the `git` documentation, visit <https://git-scm.com/book/en/v2/Git-Tools-Advanced-Merging#_checking_out_conflicts> | ||
= help: conflict markers indicate that a merge was started but could not be completed due to merge conflicts | ||
= help: to resolve a conflict, keep only the code you want and then delete the lines containing conflict markers | ||
= note: for more information, visit the `git` documentation <https://git-scm.com/book/en/v2/Git-Tools-Advanced-Merging#_checking_out_conflicts> | ||
|
||
error: aborting due to previous error | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
error: encountered diff marker | ||
error: encountered git conflict marker | ||
--> $DIR/statement.rs:10:1 | ||
| | ||
LL | <<<<<<< HEAD | ||
| ^^^^^^^ after this is the code before the merge | ||
| ^^^^^^^ between this marker and `=======` is the code that we're merging into | ||
LL | S::foo(); | ||
LL | ======= | ||
| ------- | ||
| ------- between this marker and `>>>>>>>` is the incoming code | ||
LL | S::bar(); | ||
LL | >>>>>>> branch | ||
| ^^^^^^^ above this are the incoming code changes | ||
| ^^^^^^^ | ||
| | ||
= help: if you're having merge conflicts after pulling new code, the top section is the code you already had and the bottom section is the remote code | ||
= help: if you're in the middle of a rebase, the top section is the code being rebased onto and the bottom section is the code coming from the current commit being rebased | ||
= note: for an explanation on these markers from the `git` documentation, visit <https://git-scm.com/book/en/v2/Git-Tools-Advanced-Merging#_checking_out_conflicts> | ||
= help: conflict markers indicate that a merge was started but could not be completed due to merge conflicts | ||
= help: to resolve a conflict, keep only the code you want and then delete the lines containing conflict markers | ||
= note: for more information, visit the `git` documentation <https://git-scm.com/book/en/v2/Git-Tools-Advanced-Merging#_checking_out_conflicts> | ||
|
||
error: aborting due to previous error | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
error: encountered diff marker | ||
error: encountered git conflict marker | ||
--> $DIR/struct-expr.rs:6:1 | ||
| | ||
LL | <<<<<<< HEAD | ||
| ^^^^^^^ after this is the code before the merge | ||
| ^^^^^^^ between this marker and `=======` is the code that we're merging into | ||
LL | x: 42, | ||
LL | ======= | ||
| ------- | ||
| ------- between this marker and `>>>>>>>` is the incoming code | ||
LL | x: 0, | ||
LL | >>>>>>> branch | ||
| ^^^^^^^ above this are the incoming code changes | ||
| ^^^^^^^ | ||
| | ||
= help: if you're having merge conflicts after pulling new code, the top section is the code you already had and the bottom section is the remote code | ||
= help: if you're in the middle of a rebase, the top section is the code being rebased onto and the bottom section is the code coming from the current commit being rebased | ||
= note: for an explanation on these markers from the `git` documentation, visit <https://git-scm.com/book/en/v2/Git-Tools-Advanced-Merging#_checking_out_conflicts> | ||
= help: conflict markers indicate that a merge was started but could not be completed due to merge conflicts | ||
= help: to resolve a conflict, keep only the code you want and then delete the lines containing conflict markers | ||
= note: for more information, visit the `git` documentation <https://git-scm.com/book/en/v2/Git-Tools-Advanced-Merging#_checking_out_conflicts> | ||
|
||
error: aborting due to previous error | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
error: encountered diff marker | ||
error: encountered git conflict marker | ||
--> $DIR/struct.rs:2:1 | ||
| | ||
LL | <<<<<<< HEAD | ||
| ^^^^^^^ after this is the code before the merge | ||
| ^^^^^^^ between this marker and `=======` is the code that we're merging into | ||
LL | x: u8, | ||
LL | ======= | ||
| ------- | ||
| ------- between this marker and `>>>>>>>` is the incoming code | ||
LL | x: i8, | ||
LL | >>>>>>> branch | ||
| ^^^^^^^ above this are the incoming code changes | ||
| ^^^^^^^ | ||
| | ||
= help: if you're having merge conflicts after pulling new code, the top section is the code you already had and the bottom section is the remote code | ||
= help: if you're in the middle of a rebase, the top section is the code being rebased onto and the bottom section is the code coming from the current commit being rebased | ||
= note: for an explanation on these markers from the `git` documentation, visit <https://git-scm.com/book/en/v2/Git-Tools-Advanced-Merging#_checking_out_conflicts> | ||
= help: conflict markers indicate that a merge was started but could not be completed due to merge conflicts | ||
= help: to resolve a conflict, keep only the code you want and then delete the lines containing conflict markers | ||
= note: for more information, visit the `git` documentation <https://git-scm.com/book/en/v2/Git-Tools-Advanced-Merging#_checking_out_conflicts> | ||
|
||
error: aborting due to previous error | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
error: encountered diff marker | ||
error: encountered git conflict marker | ||
--> $DIR/trait-item.rs:2:1 | ||
| | ||
LL | <<<<<<< HEAD | ||
| ^^^^^^^ after this is the code before the merge | ||
| ^^^^^^^ between this marker and `=======` is the code that we're merging into | ||
LL | fn foo() {} | ||
LL | ======= | ||
| ------- | ||
| ------- between this marker and `>>>>>>>` is the incoming code | ||
LL | fn bar() {} | ||
LL | >>>>>>> branch | ||
| ^^^^^^^ above this are the incoming code changes | ||
| ^^^^^^^ | ||
| | ||
= help: if you're having merge conflicts after pulling new code, the top section is the code you already had and the bottom section is the remote code | ||
= help: if you're in the middle of a rebase, the top section is the code being rebased onto and the bottom section is the code coming from the current commit being rebased | ||
= note: for an explanation on these markers from the `git` documentation, visit <https://git-scm.com/book/en/v2/Git-Tools-Advanced-Merging#_checking_out_conflicts> | ||
= help: conflict markers indicate that a merge was started but could not be completed due to merge conflicts | ||
= help: to resolve a conflict, keep only the code you want and then delete the lines containing conflict markers | ||
= note: for more information, visit the `git` documentation <https://git-scm.com/book/en/v2/Git-Tools-Advanced-Merging#_checking_out_conflicts> | ||
|
||
error: aborting due to previous error | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
error: encountered diff marker | ||
error: encountered git conflict marker | ||
--> $DIR/tuple-struct.rs:2:1 | ||
| | ||
LL | <<<<<<< HEAD | ||
| ^^^^^^^ after this is the code before the merge | ||
| ^^^^^^^ between this marker and `=======` is the code that we're merging into | ||
LL | u8, | ||
LL | ======= | ||
| ------- | ||
| ------- between this marker and `>>>>>>>` is the incoming code | ||
LL | i8, | ||
LL | >>>>>>> branch | ||
| ^^^^^^^ above this are the incoming code changes | ||
| ^^^^^^^ | ||
| | ||
= help: if you're having merge conflicts after pulling new code, the top section is the code you already had and the bottom section is the remote code | ||
= help: if you're in the middle of a rebase, the top section is the code being rebased onto and the bottom section is the code coming from the current commit being rebased | ||
= note: for an explanation on these markers from the `git` documentation, visit <https://git-scm.com/book/en/v2/Git-Tools-Advanced-Merging#_checking_out_conflicts> | ||
= help: conflict markers indicate that a merge was started but could not be completed due to merge conflicts | ||
= help: to resolve a conflict, keep only the code you want and then delete the lines containing conflict markers | ||
= note: for more information, visit the `git` documentation <https://git-scm.com/book/en/v2/Git-Tools-Advanced-Merging#_checking_out_conflicts> | ||
|
||
error: aborting due to previous error | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
error: encountered diff marker | ||
error: encountered git conflict marker | ||
--> $DIR/use-statement.rs:2:1 | ||
| | ||
LL | <<<<<<< HEAD | ||
| ^^^^^^^ after this is the code before the merge | ||
| ^^^^^^^ between this marker and `=======` is the code that we're merging into | ||
LL | bar, | ||
LL | ======= | ||
| ------- | ||
| ------- between this marker and `>>>>>>>` is the incoming code | ||
LL | baz, | ||
LL | >>>>>>> branch | ||
| ^^^^^^^ above this are the incoming code changes | ||
| ^^^^^^^ | ||
| | ||
= help: if you're having merge conflicts after pulling new code, the top section is the code you already had and the bottom section is the remote code | ||
= help: if you're in the middle of a rebase, the top section is the code being rebased onto and the bottom section is the code coming from the current commit being rebased | ||
= note: for an explanation on these markers from the `git` documentation, visit <https://git-scm.com/book/en/v2/Git-Tools-Advanced-Merging#_checking_out_conflicts> | ||
= help: conflict markers indicate that a merge was started but could not be completed due to merge conflicts | ||
= help: to resolve a conflict, keep only the code you want and then delete the lines containing conflict markers | ||
= note: for more information, visit the `git` documentation <https://git-scm.com/book/en/v2/Git-Tools-Advanced-Merging#_checking_out_conflicts> | ||
|
||
error: aborting due to previous error | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
git
is not the only application that uses these kinds of conflict markers.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm that's true. What about the "for more information, visit the
git
documentation" note at the end, should that perhaps be reworded to something more along the lines of "if you're usinggit
check out this documentation"?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good to me (although I feel that
git
's docs are useful even if you're not usinggit
specifically).