I suggest that when SMF installs mods, SMF automatically adds a comment before and after an added snippet of code. For example:
Original Code:
$blah = 'foobar? What does that mean?';
Add After:
$second = 'Hi, this is just random';
Final Result:
$blah = 'foobar? What does that mean?';
// Start of the ABC Mod
$second = 'Hi, this is just random';
// End of the ABC Mod
The only problem I see is that the mod could be editing HTML code, in which "//" is not a comment.
This should be the job of the mod creator.
I always put my additions between such comments, like this:
one line addition // ABC Mod -
// ABC Mod - START
multiple line addition
// ABC Mod - END
<!-- // ABC Mod - START -->
some html code
<!-- // ABC Mod - END -->
/* // ABC Mod - START */
some css code
/* // ABC Mod - END */
So mostly you just have to search for // ABC mod to find where are the changes.
You can't always make this automatic.
I agree that the mod author should add any needed comments. Since the package manager can edit anything in the file it would be impossible to do this. The code could be in a query, in PHP, part of the HTML output, in a JS file, etc.