Implement custom validation for diff/patch