If you exit the editor without saving, or if the commit message is empty after stripping comments, Git aborts with:
The -m flag is convenient for tiny changes, but it actively works against best practices. Here’s why the COMMIT_EDITMSG workflow is superior: COMMIT-EDITMSG
The COMMIT-EDITMSG file enforces (or at least encourages) best practices that -m actively discourages. If you exit the editor without saving, or
# Please enter the commit message for your changes. Lines starting # with '#' will be ignored, and an empty message aborts the commit. # # On branch feature/user-auth # Changes to be committed: # modified: src/auth/login.js # new file: src/auth/session.js # # Changes not staged for commit: # modified: README.md # # --------------------------------------------------------- # diff --git a/src/auth/login.js b/src/auth/login.js # index 123abc..456def 100644 # --- a/src/auth/login.js # +++ b/src/auth/login.js # @@ -12,7 +12,9 @@ function validateUser(user) { # ... Lines starting # with '#' will be ignored,
Fix race condition in task queue worker
feat: Add user authentication logic # Please enter the commit message for your changes. Lines starting # with '#' will be ignored, and an empty message aborts the commit. # # On branch main # Changes to be committed: # modified: src/auth.py # new file: src/user.py # # ------------------------ >8 ------------------------ # Do not modify or remove the line above. # Everything below it will be ignored. diff --git a/src/auth.py b/src/auth.py index 83db48f..d substring 100644 --- a/src/auth.py +++ b/src/auth.py @@ -1,5 +1,6 @@ import os ...