Repository navigation
use getStatus to detect conflicted repository state - #6116
Conversation
|
Cool! Couple questions:
|
Yep, this is separate to the "merge hint" feature.
I intend to keep that support around - based on the rules previously defined - and the code path gets hit whenever we update the status of the repository (like before) so there shouldn't be any change to that area. |
|
I'd like to get reviewed in time for the next beta, to give it the maximum time to bake. The PR that started this off #6082 won't be resolved without these changes, and I plan to open a fresh PR after this lands targeting the 1.5.0 release branch to ensure it gets in. |
outofambit
left a comment
There was a problem hiding this comment.
one minor request, but overall this looks good. going to test out a couple flows now to be extra sure.
|
going to merge this in ~1hr so we can unblock #6122 |
|
@shiftkey it looks like we have some conflicts now. would you mind resolving those? i'll merge this after that. |
|
@outofambit done 🍎 |
Overview
It's late, I can't sleep, and I'm restless from watching the news so I figure now is a great time to open a PR that changes how we detect merge conflicts in the app 🎉
This was started in #6082 but I wanted to move it out from there for more explicit discussion as it touches the core parts of conflict resolution flow.
Description
Currently we look at the output of
git statusto see which files are conflicted, but if a user decides to stage files outside the app (whether they're resolved or not) the conflict status markers are forgotten bygit status, so it's possible for Desktop to "forget" it's in the middle of a conflict.This affects #6082 but also other scenarios that weren't the happy path flow, like the user addressing conflicts in the app but not completing the process by committing before switching back to Desktop.
Instead of relying on
git statusoutput, this PR switches us over to look for.git/MERGE_HEADin the repository to identify when conflicts need to be resolved.The flow of this information is then like this:
getStatushas a new fieldmergeHeadFoundthat indicates whether it foundMERGE_HEADAppStore._loadStatuswe compute the new conflicted state for the repository (getConflictStatus())(still needs some cleanup)AppStore._triggerMergeConflictsFlowwe then check the current state of conflictsThis also removes some
_mergeConflictDetected()which would set the conflicted state, but didn't usegit status- this centralizes the responsibility toAppStore._loadStatus()TODO:
Release notes
Notes: no-notes