require a commit message for git
Git requires a commit message by default however SQL Source Control circumvents this setting and commits without a message. There are a few other submissions attempting to get this fixed which have been declined. Seems you are missing the point.
In the case "Empty commit message for git is invalid" the very article you've linked points out that it takes special command line flag to commit without a message. SQL source control commits without a message and provides no mechanism to prevent this. There is no configuration for git that will do this because the default git behavior is already requires a commit message! Unfortunately SQL source control is subverting this. Please stop subverting the default git commit behavior or provide a setting to enforce a commit message...
-
Aaron Templeton commented
Please be aware, I consider this to be fallout from git not honoring commit hooks in general. Which is referenced by the following support request:
https://redgate.uservoice.com/forums/39019-sql-source-control/suggestions/33730249-sql-source-control-git-hook-supportIf the hooks were honored, you would create a simple git hook that required a comment. That requirement would then be honored by all systems (command line, Visual Studio, etc), not just SQL Source Control. At present, SQL Source Control is still using the gitlib2 library which does not honor hooks. The command line does honor hooks. Visual Studio converted away from gitlib2 as of VS 2017 and thus now honors the hooks.
-
Aaron Templeton commented
This appears to be a failing of the libgit2 API which Redgate is using. It does not run any of the hooks, commit-msg in this case. Microsoft suffered the same failing with Visual Studio until they converted over to directly running the git.exe shell as of VS 2017. I would ask that you take a similar initiative. For now, we are catching the failings in a bare repository pre-receive hook which then forces the user to repair their local repository through either a "git commit --amend" or else an interactive rebase. This gets especially messy if they have already done any branch merging. Please see for reference: https://visualstudio.uservoice.com/forums/121579-visual-studio-ide/suggestions/4321705-enable-client-side-hooks-when-committing-code-to-a
-
Roman commented
I support this. It´s really annoying to get ´no comments´ commit in our system.