Hacker Read top | best | new | newcomments | leaders | about | bookmarklet login

The product being discussed here doesn't solve the issue of merge conflicts itself, but rather of eventual consistency. Merge conflicts is only a part of it, and there are some heuristics that can be used to reduce those, but eventually require manual review. Perhaps with Github Copilot this can improve?

An example of the problem we are describing is explained here: https://blog.mergequeue.com/managing-github-merges-for-high-...



sort by: page size:

I found it a bit frustrating that merge tools I used were never able to solve trivial merge conflicts automatically. So I built something myself: https://fdietze.github.io/blend

On that page you can paste your merge conflict and copy the automatically merged result, along with some useful diffs. I hope it helps someone else. So far it solves around 80% of my conflicts automatically.


Issue #333: Simultaneous changes on different instances cause incorrect merge

https://github.com/presslabs/gitfs/issues/333

Seems like conflicts are being resolved poorly.


>GitHub Copilot, but for merge conflicts?

Great idea. The corpus of data to train with would be incredible. Every merge commit across all of GitHub.


Merge conflict resolution seems like something incredibly obvious to have, that yet is a pretty unique feature for the web UI. I've done a lot of stuff with GitHub's web UI, and I pretty much hit a wall any time I do something that's going to create a merge conflict, since I never really bothered to learn Git CLI. I saw GitBook did something similar to this a while ago, but that's for books, not code.

While tools like Github check for patch conflicts, they don't check for semantic conflicts (e.g. one PR adds a new use of a function another PR removes).

This is where merge queues come into play which have a variety of names (merge queue, submit queue, merge train, etc)

I have a write up on merge queues [0] that goes into other benefits (e.g. speeding up PR builds), design considerations and their trade offs, and a comparison of various implementations.

[0] https://epage.github.io/dev/submit-queue/


I spent some time with `git mergetool` to help resolve conflicts. It's hideous but it's better than staring at inline conflict markers

Do you know what github does differently when performing a merge? I’ve noticed sometimes github says there’s a merge conflict yet when i do the merge locally using the default recursive strategy it often just merges without any conflicts. I know there are cases it can’t handle when there are conflicts, but it seems odd that it cannot merge when there are no merge conflicts.

Sounds more like a general technical github problem with merges.

Very interesting, definitely gonna try this out as I have seen similar use-cases.

Any change Github is at anytime going to show the specific merge-conflicts for a PR that cannot be merged?


The thing is that git is not supposed to be smart when it comes to merging. https://wincent.com/blog/a-look-back-bram-cohen-vs-linus-tor...

At the end of the article: This is a clearly ambiguous merge and it simply wouldn’t be right for your version control system to try "resolving" it for you.

So the strategy is that if there is any doubt you have to manually fix conflicts. This is by design.


> Require branches to be up to date before merging

Because this really doesn't scale well with the number of developers.

For larger teams the solution is to use a merge queue, e.g. https://shopify.engineering/successfully-merging-work-1000-d...

I haven't tried it, but GitHub is now offering such feature in public-beta: https://github.blog/changelog/2023-02-08-pull-request-merge-...


Is it easy to fix merge conflicts on something like an issue?

I honestly don't encounter non-trivial merge conflicts in practice on a team of 5 developers. Our repos are scoped roughly to be team-sized so the velocity is low enough to know what everyone is working on.

I guess some of this advice applies better to repos where a large number of people are working on it.

I couldn't imagine giving up the quality gate factor of PRs. Carving out the time to dissect changes catches so many bugs (although it can be received harshly sometimes compared to face to face).

Also pushing to master vs. long lived feature braches is a false dichotomy. You can have small PRs on short-lived branches that may not be a complete feature but can be merged without making the main branch unreleasable.

There is also the political factor to consider in companies where product and sales people control the selected work items. Once something is in a working state there is pressure to move on to the next thing. Fighting for quality before it is in a publishable state is a devs best defence against later rework.

The CD community is overly obsessed with velocity. Of course removing obstacles can lead to a smoother faster workflow. Take it to the extreme and it becomes a dopamine hit activity, the goal is to merge changes fast and we become unable to take the time to think deeply and reflect since it is clear that we are valued by our rate of commits over smart decisions.


Funny thing, i had this idea back in 2015, i even implemented a tool for that,

old blog post: https://medium.com/@nettsundere/on-reducing-changelog-merge-...


Love this idea - a huge pain point for many teams. I've had this issue, and am looking forward to trying this out.

I know there are a couple competitors too. How do you distinguish yourself from something like Merge.dev?


Super interesting. I saw you mentioned the headaches that came with merge requests. Did you having the same problem with separate prod, staging, test, and dev repos via a forking git workflow?

I hope someone solves the merge conflict problem once and for all. Each time there’s a merge conflict the project stops for days as no one knows how to resolve them. In the end the solution always is to delete the git repository and clone it again.

It's only readable if you already know what merge queues are. Or reading their actual docs [1].

Merge queues address the problem of how to (1) merge in a lot of changes (2) while guaranteeing no breaking/conflicting changes are merged.

[1] https://docs.github.com/en/repositories/configuring-branches...


Thanks for sharing. The issue in question has been closed, and the discussion on changing the behaviour and improving the UX happens in

- Manually resolve conflicts in merge commit on the target branch: https://gitlab.com/gitlab-org/gitlab/-/issues/25014

- Add in application explanation of what Resolve Conflicts is doing: https://gitlab.com/gitlab-org/gitlab/-/issues/25003

I've added that as a comment to https://gitlab.com/gitlab-org/gitlab-foss/-/issues/35054#not...

next

Legal | privacy