question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add option to swap the order of incoming and current changes in merge conflict resolver

See original GitHub issue

Description

In my current workflow, the most common merge conflict is additions to the changelog of the project - any incoming change is already merged, thus should be ordered above the current change, however in the current implementation, Refined Github sorts it below the current change.

An example:

  1. Chanelog contains item A and B at the beginning:
# CHANGELOG

- A
- B
  1. A PR is opened, adding item D to the changelog:
# CHANGELOG

- A
- B
- D
  1. Another PR is opened, and merged before the first PR is merged, making the incoming changelog look like this:
# CHANGELOG

- A
- B
- C
  1. This causes the following merge conflict:
# CHANGELOG

- A
- B
<<<<<<< Incoming change
- D
=======
- C
>>>>>>> Current change
  1. With the current behaviour of Refined Github, if both changes are accepted, their order wouldn’t be correct. This requires manual fixing. My recommendation is an extra button that swaps the order of the incoming and current changes, which results in the correctly ordered changelog list, with a single click:
# CHANGELOG

- A
- B
- C
- D

Screenshot

No response

Example URL

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
cheap-glitchcommented, Feb 23, 2022

Looking at the code in resolve-conflicts.ts, this seems like a relatively easy feature to implement, so, why not.

1reaction
kidonngcommented, Feb 23, 2022

Refined GitHub is not Refined Git or a substitute to git tooling, period.

Most conflicts are not going to be resolved by simply swapping the changes so it doesn’t seem worth it to support such an uncommon action.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Git merge conflict resolution: reverse order of (current ...
Now I want to accept both changes, however, they are in the wrong order. If only the master's change was first, then they...
Read more >
VS Code tips — The merge conflict code lens - YouTube
Today's VS Code tip: the merge conflict code lensYou can quickly resolve merge conflicts directly in VS Code. Use the merge conflict code ......
Read more >
How to easily merge and resolve git stash pop conflicts
There's no magic remedy for such merge conflicts. The only option for developers is to edit the file by hand and keep what...
Read more >
Strategies to resolve git conflicts using "theirs" and "ours"
You can resolve all the conflicts manually by navigating to each file, and accepting all incoming changes to the master.
Read more >
Merge conflicts - GitLab Docs
Resolve conflicts in the inline editor · Go to your merge request. · Select Overview, and scroll to the merge request reports section....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found