That’s a pretty good question tbo.
Even here at kirupaForum, we run into this. It’s best if you can keep changes to separate files. For example, you might want to keep your changes in a subclass of whatever Starling class you’re modifying, if that’s an approach that works with the changes you’re making. (The kF example is that we remove EnsureDbConsistency.rb whenever the Docker container is rebuilt, because something in that file causes permanent high CPU usage.)
The problem with version control systems like Git are that they don’t understand programs at the semantic or even syntactic level which you’d need to implement something like what you’re suggesting in your post here. Git just operates on files and strings, and can tell you various things about which lines have been changed.
In AS3, you have include
, import
, and namespaces. If Starling natively used include
in a lot of places, you could probably finagle a workable system out of that. I don’t think it does, though, so that option is out.
You have options like git patches, but they can be tricky because they rely on Git’s blanket assumption that file changes are really what matters, rather than more detailed edits like modifying a method.
If you can spare the time, it’s probably best to just keep track of what changes in Starling, and adjust your own code to match. Your own modifications can stay the same as long as you know how to apply them to knew releases and know that they won’t have broken anything new.
Not by default. If you want to be really sophisticated, you could build some infrastructure around this related to git hooks which invoke some static analysis of your programs and libraries, but that’s far outside the realm of things that I’ve seen people doing with AS3 on any consistent basis.
I suppose a rudimentary include
could override things in certain classes which you know often have things you need to override.