* 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
One major issue with the pre-hook so far was partially staged files,
because it used filenames for php lint. These changes will make the hook read the file contents from the index instead.
Great thanks to David Soria Parra.
prepare-commit-hook now uses `git symbolic-ref HEAD` instead of reading
$GIT_DIR/HEAD directly. This seems to be a more portable solution.
Thanks to Chris (cs278/ToonArmy) for the suggestion.
This pre-commit hook utilises PHP's command-line -l (lint) option, which
checks for syntax errors. In case of an error the commit is rejected and
the error displayed.
Testing is welcome.
Git supports several hooks, some of which are client-side. The
prepare-commit-msg hook is run right after a `git commit` call, before
the editor is opened. This allows the initial message to be altered.
This hook will check if the current branch name begins with `bug/`, in
which case it will prepend `[$branchname]` to the commit message. This
makes it easier to create proper commit messages.
http://wiki.phpbb.com/Git#Commit_Messages
For more information refer to the hook source.