angular-docs-cn/dev-infra
George Kalpakas 34aa5570ed fix(dev-infra): fix commit message validation in git worktrees (#36507)
Previously, the `pre-commit-validate` command (used in the `commit-msg`
git hook) assumed that the commit message was stored in
`.git/COMMIT_EDITMSG` file. This is usually true, but not when using
[git worktrees](https://git-scm.com/docs/git-worktree), where `.git` is
a file containing the path to the actual git directory.

This commit fixes it by taking advantage of the fact that git passes the
actual path of the file holding the commit message to the `commit-msg`
hook and husky exposes the arguments passed by git as
`$HUSKY_GIT_PARAMS`.

NOTE:
We cannot use the environment variable directly in the `commit-msg` hook
command, because environment variables need to be referenced differently
on Windows (`%VAR_NAME%`) vs macOS/Linux (`$VAR_NAME`). Instead, we pass
the name of the environment variable and the validation script reads the
variable's value off of `process.env`.

PR Close #36507
2020-04-09 09:46:18 -07:00
..
commit-message fix(dev-infra): fix commit message validation in git worktrees (#36507) 2020-04-09 09:46:18 -07:00
pullapprove fix(dev-infra): correct pullapprove global approval regex (#36384) 2020-04-03 11:11:30 -07:00
ts-circular-dependencies build: ts-circular-deps tool should normalize golden (#36505) 2020-04-08 12:12:58 -07:00
utils feat(dev-infra): create commit-message validation script/tooling (#36117) 2020-03-20 10:20:12 -07:00
BUILD.bazel feat(dev-infra): standard CLI commands using yargs (#36326) 2020-04-01 15:24:28 -07:00
cli.ts feat(dev-infra): standard CLI commands using yargs (#36326) 2020-04-01 15:24:28 -07:00
ng-dev ci: use dev-infra cli from local sources (#36326) 2020-04-01 15:24:29 -07:00
tmpl-package.json build: remove rollup packaging from dev-infra (#35647) 2020-03-17 12:27:07 -07:00