commit function. checks all hashes of controlled files