The PHP lint pre-commit hook fails to display any output when an error
other than a parse error is decteced.
Additionally, the hook may not display any meaningful output depending
on php.ini settings. This commit removes the dependency on php.ini.
PHPBB3-11630
If there are problems and fatal is true, print that the commit
is aborted.
If there are problems and fatal is false, print instructions
for fixing the commit.
PHPBB3-10767
When commit-msg hook is fatal, label the message as an error.
When it is not fatal, label the message as a warning.
"Syntax error" is still always an error, not sure if this
should be changed.
PHPBB3-10767
Revert "[ticket/10093] Make commit-msg always not fatal by nuking all fatal logic."
This reverts commit 88cad5523e7cdac6826dd8581e27e22a65afda26.
PHPBB3-10093
PHPBB3-10767
With that php.ini value set errors are printed to stderr, therefore
by redirecting stderr to /dev/null we also throw out the errors.
Instead merge stderr into stdout.
PHPBB3-10760
/bin/echo on freebsd and dash's builtin echo do not understand -e,
therefore -e is printed with the other messages in such cases.
Test if echo understands -e, if not do not use it.
PHPBB3-10760
We have a PHP_BIN variable but we always set it unconditionally,
therefore in order to use a different php binary one had to
modify the hook script.
Instead set PHP_BIN if it is not set.
Now one can set PHP_BIN in their environment to use a non-default
php binary.
PHPBB3-10760
Some commit messages exist only temporarily, because they are given
on commits that are intended to be squashed. Accept such commit
messages with a warning.
PHPBB3-9824
Git already handles the case of commit message being empty by
aborting the commit and displaying a reasonably helpful message.
If there is no commit message, the hook will exit with success
exit code to let git do its thing.
PHPBB3-9824
* task/cs278/git-tools:
[task/git-tools] Change the GNU --lines argument to the POSIX -l
[task/git-tools] Solve dependency on the GNU wc --max-line-length option
Changed to awk which handles the formatting differences between the
two versions of wc -- BSD version prefixes the output with spaces,
the GNU version does not.
PHPBB3-9808
This updated hook supports validates each line of the commit message
confirms to the phpBB standards [1], there are two git config options
which adjust the behaviour of the hook. They are:
* phpbb.hooks.commit-msg.fatal: Set to false for the hook to allow
commits with malformed structure, useful if you'll be squashing
or editing the commits later. True is the default value.
* phpbb.hooks.commit-msg.debug: Any integer value greater than 0 will
increase the debugging verbosity of the hook, the default value is 0.
[1] http://wiki.phpbb.com/display/DEV/Git
PHPBB3-9768