I personally like the (language-dependent) "series of actions" approach.
So, you quite literally send to the VCS "add this parameter with default value <foo> to this function", "make a copy of this function", "add this function", etc. With transactions.
And the VCS "just" replays the edits. Note that the VCS will occasionally have to munge the human-readable names in the case of what would be otherwise a conflict. But the VCS doesn't deal with things at that level anyways. You really should end up dealing with things at the AST level and rebuilding the source code when necessary.
Think of it like a refactoring tool integrated with the VCS.
Comments
I personally like the (language-dependent) "series of actions" approach.
So, you quite literally send to the VCS "add this parameter with default value <foo> to this function", "make a copy of this function", "add this function", etc. With transactions.
And the VCS "just" replays the edits. Note that the VCS will occasionally have to munge the human-readable names in the case of what would be otherwise a conflict. But the VCS doesn't deal with things at that level anyways. You really should end up dealing with things at the AST level and rebuilding the source code when necessary.
Think of it like a refactoring tool integrated with the VCS.