From bf55e0a76c07f9cebd632c4884cbe33fe86b7ffd Mon Sep 17 00:00:00 2001 From: Stefan Sundin Date: Mon, 27 Dec 2021 17:31:53 -0800 Subject: [PATCH 1/2] Add --no-show-signature to "git show" commands. This fixes errors if the user has configured the following in their ~/.gitconfig: [log] showSignature = true --- packages/react-devtools-extensions/utils.js | 2 +- scripts/release/utils.js | 4 ++-- scripts/rollup/build-all-release-channels.js | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/react-devtools-extensions/utils.js b/packages/react-devtools-extensions/utils.js index 0cbf23fc68f2a..882b414d3fbb1 100644 --- a/packages/react-devtools-extensions/utils.js +++ b/packages/react-devtools-extensions/utils.js @@ -20,7 +20,7 @@ const GITHUB_URL = 'https://github.com/facebook/react'; function getGitCommit() { try { - return execSync('git show -s --format=%h') + return execSync('git show -s --no-show-signature --format=%h') .toString() .trim(); } catch (error) { diff --git a/scripts/release/utils.js b/scripts/release/utils.js index 6a50b6f202fa6..286f0308bc1da 100644 --- a/scripts/release/utils.js +++ b/scripts/release/utils.js @@ -72,7 +72,7 @@ const getBuildInfo = async () => { const branch = await execRead('git branch | grep \\* | cut -d " " -f2', { cwd, }); - const commit = await execRead('git show -s --format=%h', {cwd}); + const commit = await execRead('git show -s --no-show-signature --format=%h', {cwd}); const checksum = await getChecksumForCurrentRevision(cwd); const dateString = await getDateStringForCommit(commit); const version = isExperimental @@ -106,7 +106,7 @@ const getChecksumForCurrentRevision = async cwd => { const getDateStringForCommit = async commit => { let dateString = await execRead( - `git show -s --format=%cd --date=format:%Y%m%d ${commit}` + `git show -s --no-show-signature --format=%cd --date=format:%Y%m%d ${commit}` ); // On CI environment, this string is wrapped with quotes '...'s diff --git a/scripts/rollup/build-all-release-channels.js b/scripts/rollup/build-all-release-channels.js index 1f31df0d0c445..6cdeb7566c32c 100644 --- a/scripts/rollup/build-all-release-channels.js +++ b/scripts/rollup/build-all-release-channels.js @@ -19,11 +19,11 @@ const { // by configuring an environment variable. const sha = String( - spawnSync('git', ['show', '-s', '--format=%h']).stdout + spawnSync('git', ['show', '-s', '--no-show-signature', '--format=%h']).stdout ).trim(); let dateString = String( - spawnSync('git', ['show', '-s', '--format=%cd', '--date=format:%Y%m%d', sha]) + spawnSync('git', ['show', '-s', '--no-show-signature', '--format=%cd', '--date=format:%Y%m%d', sha]) .stdout ).trim(); From b799cfdb55563da77fc04b7376f92c72576f742f Mon Sep 17 00:00:00 2001 From: Stefan Sundin Date: Mon, 27 Dec 2021 18:03:22 -0800 Subject: [PATCH 2/2] yarn prettier-all --- scripts/release/utils.js | 4 +++- scripts/rollup/build-all-release-channels.js | 10 ++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/scripts/release/utils.js b/scripts/release/utils.js index 286f0308bc1da..7a940f8f65fb4 100644 --- a/scripts/release/utils.js +++ b/scripts/release/utils.js @@ -72,7 +72,9 @@ const getBuildInfo = async () => { const branch = await execRead('git branch | grep \\* | cut -d " " -f2', { cwd, }); - const commit = await execRead('git show -s --no-show-signature --format=%h', {cwd}); + const commit = await execRead('git show -s --no-show-signature --format=%h', { + cwd, + }); const checksum = await getChecksumForCurrentRevision(cwd); const dateString = await getDateStringForCommit(commit); const version = isExperimental diff --git a/scripts/rollup/build-all-release-channels.js b/scripts/rollup/build-all-release-channels.js index 6cdeb7566c32c..6793507165867 100644 --- a/scripts/rollup/build-all-release-channels.js +++ b/scripts/rollup/build-all-release-channels.js @@ -23,8 +23,14 @@ const sha = String( ).trim(); let dateString = String( - spawnSync('git', ['show', '-s', '--no-show-signature', '--format=%cd', '--date=format:%Y%m%d', sha]) - .stdout + spawnSync('git', [ + 'show', + '-s', + '--no-show-signature', + '--format=%cd', + '--date=format:%Y%m%d', + sha, + ]).stdout ).trim(); // On CI environment, this string is wrapped with quotes '...'s