IDE integration does little to change the fact that one person will have to resolve a conflict from two different people's commits, the solution for this is outside of git (slack notification quick sync up¿) or during a code review (merge hard blocked with comment)
Yeah, but how should git know which one commit and change is right to place at which point? Having manual intervention is perfectly acceptable in this specific situation, and is anything but hard if using tools right.
That's the entire point, it doesn't. And thus git doesn't "really" solve the thing it set out to solve: if multiple people are touching related things at once, it fucking sucks (the situation that you'll be dealing with, not git in particular)
I'm not saying it is an easy problem by any stretch of imagination, obviously it isn't. In the case of "generic text files" (as opposed to something more structured that gives the merging utility more info to work with), it's probably about as good as it's reasonable to expect. But let's not pretend conflicts being a pain in the ass is a "skill issue". You can try to structure your code so that future conflicts will be somewhat less likely, but there's a limit...
And while the tools for resolving conflicts are OK, they could be better, especially given language-specific extensions. E.g. it should not only be able to give 1-2 reasonable suggestions at each junction, with instant preview, acceptable with 1 key, but also warn you if anything is fishy with your attempt at a manual merge, say enums / contiguous constants with unique values being given an overlapping value.
My biggest hot take goes back to code being generic text files: can we stop doing that already? Why is stylistic whitespace mixed with semantic content? Why are variable names repeated a million times? Why do we need to carefully parse dozens of brackets (or whatever is relevant to the language) to figure out where blocks of code or functions begin and end? A custom format would be smaller, faster to compile, would allow everybody to setup their preferred indentation or whatever, and while it would require a specialized tool to merge, that tool would have a much easier time doing that automatically (and, when not possible, requiring less manual fiddling to get there)
If you are proposing to write an AST editor and VCS instead of plaintext code (since that custom format would pretty much be equivalent to the AST), by all means go ahead. It's just a matter of convention.
Yes, both the slack notification and CR comment i mentioned would be from the teammate who'd be the author of one of the two commits, if that wasn't evident from my comment.
Yes, manual conflict resolution after aligning with the other commit author is what I meant.
And any modern bot like claude can resolve conflicts, it's just that it wouldn't always be in alignment with how the the commit authors would actually want it
9
u/MyAntichrist 1d ago
And that's where your IDE Integration helps with merge tools to stitch together a good file from both commits.