From 9a7e6bf0d0cf08114b74c9fe45c06e60a5e496e4 Mon Sep 17 00:00:00 2001 From: Stefan Sundin Date: Tue, 11 Jan 2022 09:14:08 -0800 Subject: [PATCH] Add --no-show-signature to "git show" commands (#23038) * Add --no-show-signature to "git show" commands. This fixes errors if the user has configured the following in their ~/.gitconfig: [log] showSignature = true * yarn prettier-all --- packages/react-devtools-extensions/utils.js | 2 +- scripts/release/utils.js | 6 ++++-- scripts/rollup/build-all-release-channels.js | 12 +++++++++--- 3 files changed, 14 insertions(+), 6 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..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 --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 +108,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..6793507165867 100644 --- a/scripts/rollup/build-all-release-channels.js +++ b/scripts/rollup/build-all-release-channels.js @@ -19,12 +19,18 @@ 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]) - .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