From a9c69e5db13308315b3d3ebfa419eb5dba5d4dc9 Mon Sep 17 00:00:00 2001 From: Paul Gschwendtner Date: Tue, 26 Mar 2019 20:15:38 +0100 Subject: [PATCH] build: staging script should ignore pre-commit hook (#15612) Currently if the caretaker stages a new release, but does not have the `git-clang-format` pre-commit hook configured properly (there is some additional configuration involved), the staging script will fail. In order to avoid these failures, we just ignore the pre-commit hook when a commit is created automatically by the release scripts. The release script only makes changes which conform with the clang-format's/ the project style guidelines. --- tools/release/git/git-client.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/release/git/git-client.ts b/tools/release/git/git-client.ts index 5861b79cd37..91fc060d59c 100644 --- a/tools/release/git/git-client.ts +++ b/tools/release/git/git-client.ts @@ -61,7 +61,9 @@ export class GitClient { /** Creates a new commit within the current branch with the given commit message. */ createNewCommit(message: string): boolean { - return this._spawnGitProcess(['commit', '-m', message]).status === 0; + // Disable pre-commit hooks when creating a commit. Developers might not have set up + // their Git configuration for the "git-clang-format" pre-commit hook. + return this._spawnGitProcess(['commit', '--no-verify', '-m', message]).status === 0; } /** Gets the title of a specified commit reference. */