-
Notifications
You must be signed in to change notification settings - Fork 526
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
Base branch: Safely handle divergence #4899
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
ba3329e
to
901e225
Compare
b72085e
to
2a4bbef
Compare
2a4bbef
to
624e5c3
Compare
1ef2625
to
5de527d
Compare
7755dfd
to
e08fdd2
Compare
e08fdd2
to
b3da0b7
Compare
b3da0b7
to
72d0050
Compare
72d0050
to
bb09576
Compare
Lets separate out the update of base branch (because we can in the future show exactly what is gonna happen to branches) |
bd6393e
to
935dd4a
Compare
a935b51
to
f536de2
Compare
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.
@Byron @Caleb-T-Owens let me know what you think or if there are some other meaningful things you think I should add tests for :)
|
||
#[test] | ||
fn test_conflicted_head_branch_resolve_divergence_hard_reset() { | ||
let test_repository = TestingRepository::open(); | ||
let initial_commit = test_repository.commit_tree(None, &[("foo.txt", "bar")]); | ||
let old_target = test_repository.commit_tree(Some(&initial_commit), &[("foo.txt", "baz")]); | ||
let branch_head = test_repository.commit_tree(Some(&old_target), &[("foo.txt", "fux")]); | ||
// new target diverged from old target | ||
let new_target = test_repository.commit_tree(Some(&initial_commit), &[("foo.txt", "qux")]); | ||
|
||
let branch = make_branch(branch_head.id(), branch_head.tree_id()); |
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.
@Byron 👋
From here down I've added some tests for what I consider it's the main parts that should be tested:
- That the base-branch divergence resolution approach correctly updates the state of the branches' upstream integration statuses
- That the computed resolutions yield the expected results depending on the chosen base-branch divergence resolution approach
f536de2
to
35b2e44
Compare
35b2e44
to
ccd699a
Compare
ccd699a
to
e15bd28
Compare
e15bd28
to
53cf681
Compare
4ed2641
to
5c504c8
Compare
5c504c8
to
eb962a1
Compare
eb962a1
to
89dca28
Compare
89dca28
to
6950af2
Compare
6950af2
to
265d957
Compare
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.
Thank you very much!
☕️ Reasoning
The application doesn't display any kind of information related to base branch divergence.
It should detect this, raise this to the user and present alternative actions to address this.
Scenario
Expected behavior would be to have some information about this and the ability to restore the application to the latest version of the target upstream.
🧢 Changes
📋 TODO
Allow the user to use edit mode on a base-branch conflict
Since we're allowing the user to rebase or merge changes into the base-branch, we can end up with conflicted commits there.
We already display and signal it, but we need to enable edit mode on base-branch conflicts.