modifying files in commit hook doesn't work well