Comments (5)
Empty commiy message (completely deleting ALL content from the file buffer including comments):
======== Execute hook: commit-msg ==============================================
Action: \CaptainHook\App\Hook\Message\Action\Beams
--------------------------------------------------------------------------------
CAPTAINHOOK FOUND 1 PROBLEM IN YOUR COMMIT MESSAGE
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Subject line has to start with an upper case letter
--------------------------------------------------------------------------------
In PHP.php line 51:
Execution failed:
Commit message validation failed in /home/daniel/www/dantleech/maestro/vend
or/captainhook/captainhook/src/Hook/Message/Action/Book.php line 63
Having an empty line:
======== Execute hook: commit-msg ==============================================
Action: \CaptainHook\App\Hook\Message\Action\Beams
All rules passed
Aborting commit due to empty commit message.
Just exiting:
======== Execute hook: commit-msg ==============================================
Action: \CaptainHook\App\Hook\Message\Action\Beams
--------------------------------------------------------------------------------
CAPTAINHOOK FOUND 1 PROBLEM IN YOUR COMMIT MESSAGE
--------------------------------------------------------------------------------
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# On branch master
# Your branch is up to date with 'origin/master'.
#
# Changes to be committed:
# modified: lib/Task/Task.php
#
# Changes not staged for commit:
# modified: captainhook.json
#
# Untracked files:
# .php_cs.cache
# .phpunit.result.cache
# STDERR
# dot
# dot.dot
# example/
# lsp-client.log
# maestro.log
# out
# out.png
# out.ps
# phpactor.log
# replay.json
#
# ------------------------ >8 ------------------------
# Do not modify or remove the line above.
# Everything below it will be ignored.
diff --git a/lib/Task/Task.php b/lib/Task/Task.php
index 279ba80..d9c6628 100644
--- a/lib/Task/Task.php
+++ b/lib/Task/Task.php
@@ -1,5 +1,6 @@
<?php
+
namespace Maestro\Task;
interface Task
--------------------------------------------------------------------------------
Subject line has to start with an upper case letter
--------------------------------------------------------------------------------
In PHP.php line 51:
Execution failed:
Commit message validation failed in /home/daniel/www/dantleech/maestro/vend
or/captainhook/captainhook/src/Hook/Message/Action/Book.php line 63
from captainhook.
The diff can also cause a false positive on the body length:
--------------------------------------------------------------------------------
Body lines should not exceed 72 characters
Line 15 of your body exceeds the max line length
Subject and body have to be separated by a blank line
--------------------------------------------------------------------------------
from captainhook.
Yes the Cap'n removes comment lines from your commit message before validating it.
Since they will be removed by git that's seemed like a reasonable thing to do.
Somehow this line
# ------------------------ >8 ------------------------
makes git ignore all lines below.
I have to check the syntax for this and make the message parser a lot smarter, because right now it thinks that the diff is part of the commit message. That's why it fails.
from captainhook.
This is fixed in sebastianfeldmann/git
version 2.2.2.
If you run composer update
you should get the latest version including the scissors (--- >8 ---) fix.
The odd thing I noticed.
If I use
git commit
# exit with empty commit message
Aborting commit due to empty commit message.
everything works now.
If I use
git commit -v
# exit with empty message
# the hooks run and fail due to the empty commit message
But if I add a space or an empty line to the commit message it fails like the version without - v
.
Can you verify this or is it just my machine?
from captainhook.
I don't want to scream "wolf" too fast, but this seems to be a git issue.
If you run git commit -v
somehow the commit is not aborted if the message is empty.
But if the message contains a whitespace git will cancel the commit.
Seems strange but so far all experiments confirm my suspicions.
For some reason the commit-message
hook gets triggered even if the commit message is empty and the whole commit should be canceled by git.
from captainhook.
Related Issues (20)
- Support for Relative Path to CaptainHook Executable in Generated Hooks HOT 5
- Allow Staged and Changed files condition to define diff-filter HOT 1
- PHP Fatal error: Argument #2 ($filter) must be of type array HOT 7
- InjectIssueKeyFromBranch does not work as expected HOT 10
- http://captainhook.info is not available anymore? HOT 1
- Support Symfony 7 HOT 2
- $CHANGED_FILES placeholder is empty for first push HOT 1
- [FEATURE-REQUEST] New placeholder `ALL_CHANGED_FILES` HOT 17
- Docker mode not working? HOT 9
- Linting fails when it shouldn't? HOT 3
- Default config file does not work HOT 3
- Error 'The "--input" option does not exist' when rerunning the hooks HOT 1
- captainhook/captainhook-phar failing, prefer captainhook/captainhook in README HOT 3
- Running Hooks in Subrepositories fails HOT 10
- Execute PHAR hook installation without an autoloader HOT 9
- [Feature] Parallel execution of actions HOT 1
- [Bug?] Pre-push hook failing with ddev/docker HOT 4
- Installation not working behind a proxy
- Install fails with a missing class HOT 13
- Hello HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from captainhook.