I've worked with people who were adamant white space and formatting changes should always be in their own commit. But in my experience, it's never been a problem.
I've worked with people who were adamant white space and formatting changes should always be in their own commit. But in my experience, it's never been a problem.
It's a pain in the ass. At least if the whitespace / formatting changes are in their own commit, then you can just merge that one first and continue on with your day, rather than having to manually resolve the merge problem potentially leading to more merging problems down the road.
Add different ways to format code in, say, C, C++, Java, and so on, and you'd add a whole lot of unnecessary complexity into a version control software...
Yes, being content aware is the key. No question, it isn't easy. I'm not sure it's possible, but one could imagine that another tool wraps itself around git, and has a better understanding of the full the underlying project, the languages used, and their dependencies.
Git can still be used for the lower level commits, but the higher level wrapper could do much more.
With a schematic you can reorganize a schematic and then compare the netlist and parts and if they are different you broke something. You can generate meaningful descriptions of of changes. Changed all the parts of this type to that type. Renamed these parts to these new names.
Problem is no one designs languages to be able to do that.
As a note, in Scala, scalameta will do just that and then dump out a structured view (in a specified protobuf format) of your code which you can work with.
There are other problems, anything more than naively comparing and diffing AST's is a hard problem. I've also seen some really bad things with editing non text data. Like the file you've been editing for a few days is corrupted.
And I don't see why you can't do this sort of thing with most languages that we already had. Indeed, this immediately reminded me of structured code search in IntelliJ IDEA, which has been around since early 00s. What's special about C# in that regard?
Not unique but far as I understand you can parse a C# module without knowing anything about it's dependencies.
> There's nothing wrong with Unicode text as a serialization format, so long as all your diff tools operate on the deserialized graph.
The point is you need to actually edit the de-serialized graph not the Unicode expression of program. Changes to the code aren't expressed as changed to the text, they're expressed as changes to the graph.
AKA diff is object foo nenamed object baz. And that's it.
And you don't have to edit the graph. You can still edit the serialized representation directly. So long as you diff the graph, how the changes were made doesn't matter. For example, there already are XML and JSON diff tools that do advanced structural diffing, and they don't care how that XML or JSON was edited.
I think your suggestion is most useful for making code review easier. It's annoying to read 5 commits to understand a change versus just one.