I would like to modify a test to comment in some extra code:
- /*SimpleMonitor monitor = new SimpleMonitor();
- machine.attachMonitor(monitor);
You could declare for your file a content filter driver ( a 'clean' script) which would automatically, on checkin, comment the right line.
That is done in a .gitattributes file: see for instance "Does .gitignore have an equivalent for version controlled files?".
(image from "Customizing Git Attributes" from the Git Book)
git config filter.<filtername>.clean ./<filterscript>
You can have <filterscript>
versioned in your repo.