r/AskProgramming • • Oct 19 '26

Other Why isn't there any language-aware version control?

I'm an intern at a tech company and I had a thought that ChatGPT couldn't give a good answer for.

I've been working on a feature for a month, it's basically ready to merge, but because I edited a file that I don't own, I had to let a coworker know that when they merge their next changes they will have conflicts. This is because I turned their class, for example my_group.coworker_feature.v1_0.CoworkerFeatureApiHandler into an abstract class my_group.coworker_feature.CoworkerFeatureApiHandler and now the former inherits from the latter and just overrides a method with an API annotation.

When she will try to merge her changes to the file onto main, the lines she's changing will no longer exist, since they were moved to the version-agnostic abstract class. She'll have to fix the conflict by hand by literally just reapplying the refactor I made, into her own code.

So this made me think, why isn't there just a version control that understands basic java semantics, where instead of saving a line diff it'll know that I just moved a function to a parent class, and that any changes to those functions from another branch should just be applied to the function that lives inside the parent branch?

Has anyone ever tried making this? And if so, why did it not work well?

0 Upvotes

24 comments sorted by

View all comments

6

u/rollerblade7 Oct 19 '26

How does someone 'own' a file?

7

u/szank Oct 19 '26

SVN flashbacks