4 ms·
For example, I recently spent several hours fixing a pre-commit hook that would apply clang-format to any file changed and then `git add` the file. Thus, the p
by slavik81 5y ago
For example, I recently spent several hours fixing a pre-commit hook that would apply clang-format to any file changed and then `git add` the file.
Thus, the patch shown in `git commit --verbose` would be very misleading. It would show the original patch, not what was actually going to be committed. Due to the hook, any other changes that happened to be in the same file would be silently commited (even if they were never staged for commit).