Skip to content

Commit

Permalink
Add --no-show-signature to "git show" commands (#23038)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
stefansundin authored Jan 11, 2022
1 parent 2f26eb8 commit 9a7e6bf
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/react-devtools-extensions/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
6 changes: 4 additions & 2 deletions scripts/release/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
12 changes: 9 additions & 3 deletions scripts/rollup/build-all-release-channels.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9a7e6bf

Please sign in to comment.