Home / Function/ getPreviousCommitSha() — react Function Reference

getPreviousCommitSha() — react Function Reference

Architecture documentation for the getPreviousCommitSha() function in prepare-release.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  1dd9028e_1ba8_585b_bffc_a50bd4954581["getPreviousCommitSha()"]
  497982e7_e1b1_28ad_fd0c_dc03591e3177["prepare-release.js"]
  1dd9028e_1ba8_585b_bffc_a50bd4954581 -->|defined in| 497982e7_e1b1_28ad_fd0c_dc03591e3177
  cadb4d3f_5109_b4e0_6f72_18067565caef["main()"]
  cadb4d3f_5109_b4e0_6f72_18067565caef -->|calls| 1dd9028e_1ba8_585b_bffc_a50bd4954581
  style 1dd9028e_1ba8_585b_bffc_a50bd4954581 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

scripts/devtools/prepare-release.js lines 142–172

async function getPreviousCommitSha() {
  const choices = [];

  const lines = await execRead(`
    git log --max-count=5 --topo-order --pretty=format:'%H:::%s:::%as' HEAD -- ${join(
      ROOT_PATH,
      PACKAGE_PATHS[0]
    )}
  `);

  lines.split('\n').forEach((line, index) => {
    const [hash, message, date] = line.split(':::');
    choices.push({
      name: `${chalk.bold(hash)} ${chalk.dim(date)} ${message}`,
      value: hash,
      short: date,
    });
  });

  const {sha} = await inquirer.prompt([
    {
      type: 'list',
      name: 'sha',
      message: 'Which of the commits above marks the last DevTools release?',
      choices,
      default: choices[0].value,
    },
  ]);

  return sha;
}

Domain

Subdomains

Called By

Frequently Asked Questions

What does getPreviousCommitSha() do?
getPreviousCommitSha() is a function in the react codebase, defined in scripts/devtools/prepare-release.js.
Where is getPreviousCommitSha() defined?
getPreviousCommitSha() is defined in scripts/devtools/prepare-release.js at line 142.
What calls getPreviousCommitSha()?
getPreviousCommitSha() is called by 1 function(s): main.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free