Commit Graph

3 Commits

Author SHA1 Message Date
George Kalpakas ab30b2ad01 build: mention where to find the invalid commit message, when validation fails (#32420)
Whenever someone tries to commit (by running `git commit` directly or
indirectly), a `commit-msg` git hook is run to validate the commit
message. If the validation fails, an error message is printed and the
commit is aborted.

Occasionally, people may have written a non-trivial commit message which
could turn out to be invalid (due a small typo for example). In that
case, it is frustrating to "lose" the whole message and have to write it
all over again (from memory). This is frustrating and has happened to me
enough times to finally seek a solution.

Fortunately, it turns out that git stores the last commit message in
`.git/COMMIT_EDITMSG`, so it is easy to get it back (as long as you know
where to look for it). This commit mentions this info in the validation
error to help people that might not know about it.

(This issue is probably mostly relevant for people using git from the
command-line and not through a UI, but it won't hurt in either case.)

PR Close #32420
2019-08-30 13:52:54 -04:00
Fabio Picheli f9a4abb6dc fix: missing semi-colon and empty line (#26945)
PR Close #26945
2018-11-05 11:37:55 -08:00
Victor Berchet 7a406a32fa refactor: add a commit-msg git hook to check commit messages (#22969)
The commit command will fail if the commit message header does not follow the
Angular convetions as defined in /CONTRIBUTING.md.

You can force the commit by adding the `--no-verify` option.

NOTE:
You should remove all unused hooks (in <angular>/.git/hooks) before running
`yarn` so that husky hooks are installed correctly.

PR Close #22969
2018-03-26 18:34:31 -04:00