MCPcopy Index your code
hub / github.com/react/react / getPreviousCommitSha

Function getPreviousCommitSha

scripts/devtools/prepare-release.js:142–172  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

140}
141
142async function getPreviousCommitSha() {
143 const choices = [];
144
145 const lines = await execRead(`
146 git log --max-count=5 --topo-order --pretty=format:'%H:::%s:::%as' HEAD -- ${join(
147 ROOT_PATH,
148 PACKAGE_PATHS[0]
149 )}
150 `);
151
152 lines.split('\n').forEach((line, index) => {
153 const [hash, message, date] = line.split(':::');
154 choices.push({
155 name: `${chalk.bold(hash)} ${chalk.dim(date)} ${message}`,
156 value: hash,
157 short: date,
158 });
159 });
160
161 const {sha} = await inquirer.prompt([
162 {
163 type: 'list',
164 name: 'sha',
165 message: 'Which of the commits above marks the last DevTools release?',
166 choices,
167 default: choices[0].value,
168 },
169 ]);
170
171 return sha;
172}
173
174async function getReleaseType() {
175 const {releaseType} = await inquirer.prompt([

Callers 1

mainFunction · 0.85

Calls 3

execReadFunction · 0.70
forEachMethod · 0.65
pushMethod · 0.65

Tested by

no test coverage detected