-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Conversation
This comment has been minimized.
This comment has been minimized.
c065485
to
fcb0371
Compare
"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", |
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.
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).
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"); |
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 using git
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 using git
specifically).
☔ The latest upstream changes (presumably #116889) made this pull request unmergeable. Please resolve the merge conflicts. |
ping from triage - can you post your status on this PR? This PR has not received an update in a few months. FYI: when a PR is ready for review, send a message containing Or if you're not going to continue, please close it. Thank you! |
Improve conflict marker recovery <!-- If this PR is related to an unstable feature or an otherwise tracked effort, please link to the relevant tracking issue here. If you don't know of a related tracking issue or there are none, feel free to ignore this. This PR will get automatically assigned to a reviewer. In case you would like a specific user to review your work, you can assign it to them by using r? <reviewer name> --> closes rust-lang#113826 r? `@estebank` since you reviewed rust-lang#115413 cc: `@rben01` since you opened up the issue in the first place
Improve conflict marker recovery <!-- If this PR is related to an unstable feature or an otherwise tracked effort, please link to the relevant tracking issue here. If you don't know of a related tracking issue or there are none, feel free to ignore this. This PR will get automatically assigned to a reviewer. In case you would like a specific user to review your work, you can assign it to them by using r? <reviewer name> --> closes rust-lang#113826 r? ``@estebank`` since you reviewed rust-lang#115413 cc: ``@rben01`` since you opened up the issue in the first place
Improve conflict marker recovery <!-- If this PR is related to an unstable feature or an otherwise tracked effort, please link to the relevant tracking issue here. If you don't know of a related tracking issue or there are none, feel free to ignore this. This PR will get automatically assigned to a reviewer. In case you would like a specific user to review your work, you can assign it to them by using r? <reviewer name> --> closes rust-lang#113826 r? ```@estebank``` since you reviewed rust-lang#115413 cc: ```@rben01``` since you opened up the issue in the first place
Rollup merge of rust-lang#126125 - dev-ardi:conflict-markers, r=estebank Improve conflict marker recovery <!-- If this PR is related to an unstable feature or an otherwise tracked effort, please link to the relevant tracking issue here. If you don't know of a related tracking issue or there are none, feel free to ignore this. This PR will get automatically assigned to a reviewer. In case you would like a specific user to review your work, you can assign it to them by using r? <reviewer name> --> closes rust-lang#113826 r? ```@estebank``` since you reviewed rust-lang#115413 cc: ```@rben01``` since you opened up the issue in the first place
Applied suggestions in #113826 with minor modifications.
The current output is as follows:
w/o diff3
r? @estebank