From 96d31d8c9f4aa544701e9ee0f03e22ef7d12d2bb Mon Sep 17 00:00:00 2001 From: Joey Perrott Date: Thu, 15 Jul 2021 16:35:57 -0700 Subject: [PATCH] fix(dev-infra): prevent verbose messaging of git checkout and commit for release (#42871) Prevent logging verbose messages to the output for commit and checkout during the release process. PR Close #42871 --- dev-infra/ng-dev.js | 10 +++++----- dev-infra/release/publish/actions.ts | 10 +++++----- dev-infra/utils/testing/virtual-git-client.ts | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/dev-infra/ng-dev.js b/dev-infra/ng-dev.js index e993e07c96..ef56b441e7 100755 --- a/dev-infra/ng-dev.js +++ b/dev-infra/ng-dev.js @@ -6547,14 +6547,14 @@ class ReleaseAction { */ createLocalBranchFromHead(branchName) { return tslib.__awaiter(this, void 0, void 0, function* () { - this.git.run(['checkout', '-B', branchName]); + this.git.run(['checkout', '-q', '-B', branchName]); }); } /** Pushes the current Git `HEAD` to the given remote branch in the configured project. */ pushHeadToRemoteBranch(branchName) { return tslib.__awaiter(this, void 0, void 0, function* () { // Push the local `HEAD` to the remote branch in the configured project. - this.git.run(['push', this.git.getRepoGitUrl(), `HEAD:refs/heads/${branchName}`]); + this.git.run(['push', '-q', this.git.getRepoGitUrl(), `HEAD:refs/heads/${branchName}`]); }); } /** @@ -6581,7 +6581,7 @@ class ReleaseAction { pushArgs.push('--set-upstream'); } // Push the local `HEAD` to the remote branch in the fork. - this.git.run(['push', repoGitUrl, `HEAD:refs/heads/${branchName}`, ...pushArgs]); + this.git.run(['push', '-q', repoGitUrl, `HEAD:refs/heads/${branchName}`, ...pushArgs]); return { fork, branchName }; }); } @@ -6656,7 +6656,7 @@ class ReleaseAction { checkoutUpstreamBranch(branchName) { return tslib.__awaiter(this, void 0, void 0, function* () { this.git.run(['fetch', '-q', this.git.getRepoGitUrl(), branchName]); - this.git.run(['checkout', 'FETCH_HEAD', '--detach']); + this.git.run(['checkout', '-q', 'FETCH_HEAD', '--detach']); }); } /** @@ -6666,7 +6666,7 @@ class ReleaseAction { */ createCommit(message, files) { return tslib.__awaiter(this, void 0, void 0, function* () { - this.git.run(['commit', '--no-verify', '-m', message, ...files]); + this.git.run(['commit', '-q', '--no-verify', '-m', message, ...files]); }); } /** diff --git a/dev-infra/release/publish/actions.ts b/dev-infra/release/publish/actions.ts index c33f1950a4..437f0ccc79 100644 --- a/dev-infra/release/publish/actions.ts +++ b/dev-infra/release/publish/actions.ts @@ -211,13 +211,13 @@ export abstract class ReleaseAction { * existing branches in case of a collision. */ protected async createLocalBranchFromHead(branchName: string) { - this.git.run(['checkout', '-B', branchName]); + this.git.run(['checkout', '-q', '-B', branchName]); } /** Pushes the current Git `HEAD` to the given remote branch in the configured project. */ protected async pushHeadToRemoteBranch(branchName: string) { // Push the local `HEAD` to the remote branch in the configured project. - this.git.run(['push', this.git.getRepoGitUrl(), `HEAD:refs/heads/${branchName}`]); + this.git.run(['push', '-q', this.git.getRepoGitUrl(), `HEAD:refs/heads/${branchName}`]); } /** @@ -245,7 +245,7 @@ export abstract class ReleaseAction { pushArgs.push('--set-upstream'); } // Push the local `HEAD` to the remote branch in the fork. - this.git.run(['push', repoGitUrl, `HEAD:refs/heads/${branchName}`, ...pushArgs]); + this.git.run(['push', '-q', repoGitUrl, `HEAD:refs/heads/${branchName}`, ...pushArgs]); return {fork, branchName}; } @@ -330,7 +330,7 @@ export abstract class ReleaseAction { /** Checks out an upstream branch with a detached head. */ protected async checkoutUpstreamBranch(branchName: string) { this.git.run(['fetch', '-q', this.git.getRepoGitUrl(), branchName]); - this.git.run(['checkout', 'FETCH_HEAD', '--detach']); + this.git.run(['checkout', '-q', 'FETCH_HEAD', '--detach']); } /** @@ -339,7 +339,7 @@ export abstract class ReleaseAction { * @param files List of project-relative file paths to be commited. */ protected async createCommit(message: string, files: string[]) { - this.git.run(['commit', '--no-verify', '-m', message, ...files]); + this.git.run(['commit', '-q', '--no-verify', '-m', message, ...files]); } diff --git a/dev-infra/utils/testing/virtual-git-client.ts b/dev-infra/utils/testing/virtual-git-client.ts index ad8cbcc963..0042d6e409 100644 --- a/dev-infra/utils/testing/virtual-git-client.ts +++ b/dev-infra/utils/testing/virtual-git-client.ts @@ -107,7 +107,7 @@ export class VirtualGitClient extends AuthenticatedGitClient { /** Handler for the `git push` command. */ private _push(args: string[]) { - const [repoUrl, refspec] = parseArgs(args)._; + const [repoUrl, refspec] = parseArgs(args, {boolean: ['q']})._; const ref = this._unwrapRefspec(refspec); const name = ref.destination || ref.source; const existingPush = @@ -161,7 +161,7 @@ export class VirtualGitClient extends AuthenticatedGitClient { /** Handler for the `git checkout` command. */ private _checkout(rawArgs: string[]) { - const args = parseArgs(rawArgs, {boolean: ['detach', 'B']}); + const args = parseArgs(rawArgs, {boolean: ['detach', 'B', 'q']}); const createBranch = args['B']; const detached = args['detach']; const [target] = args._;