![]() ![]() This obscure race condition can occur if we e.g. ![]() (Merged by Junio C Hamano - gitster - in commit 7431379, ) hooks: fix an obscure TOCTOU "did we just run a hook?" raceįix a Time-of-check to time-of-use ( TOCTOU) race in code added in 680ee55 (" commit: skip discarding the index if there is no pre-commit hook",, Git v2.15.0-rc0 - merge listed in batch #3). See commit a8cc594 (fixed with commit 4369e3a1), commit 9f6e63b () by Ævar Arnfjörð Bjarmason ( avar). With Git 2.36 (Q2 2022), the callers of run_commit_hook() to learn if it got "success" because the hook succeeded or because there wasn't any hook. The same process would be necessary in case of a git rebase -continue, after a merge conflict resolution. So if a cherry-pick triggers a pre-commit hook, you might, as in this blog post, have to comment/disable somehow that hook in order for your git cherry-pick to proceed. ![]() Has been optimized out when we know we do not run the pre-commit hook.ĭavi Lima points out in the comments the git cherry-pick does not support -no-verify. Just in case the pre-commit hook has updated it in the middle this " git commit" used to discard the index and re-read from the filesystem (Merged by Junio C Hamano - gitster - in commit c3e034f, ) commit: skip discarding the index if there is no pre-commit hook See commit 680ee55 () by Kevin Willford (``). Note: Git 2.14.x/2.15 improves the -no-verify behavior: Only git push -no-verify would skip the hook. See also githooks(5).Īs commented by Blaise, -n can have a different role for certain commands.įor instance, git push -n is actually a dry-run push. This option bypasses the pre-commit and commit-msg hooks. Maybe (from git commit man page): git commit -no-verify -m "commit message" ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |