Home / Function/ loadCommitDetails() — react Function Reference

loadCommitDetails() — react Function Reference

Architecture documentation for the loadCommitDetails() function in data.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  749f1cd7_543f_37b2_2ead_701de85e913a["loadCommitDetails()"]
  60d0c3ed_734d_56fa_7d21_b53dc8d70afe["data.js"]
  749f1cd7_543f_37b2_2ead_701de85e913a -->|defined in| 60d0c3ed_734d_56fa_7d21_b53dc8d70afe
  style 749f1cd7_543f_37b2_2ead_701de85e913a fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

scripts/tasks/generate-changelog/data.js lines 85–106

async function loadCommitDetails(sha, {log}) {
  log(`Loading commit details for ${sha}...`);
  const format = ['%H', '%s', '%an', '%ae', '%ct', '%B'].join('%n');
  const {stdout} = await execFileAsync(
    'git',
    ['show', '--quiet', `--format=${format}`, sha],
    {cwd: repoRoot, maxBuffer: 10 * 1024 * 1024}
  );

  const [commitSha, subject, authorName, authorEmail, timestamp, ...rest] =
    stdout.split('\n');
  const body = rest.join('\n').trim();

  return {
    sha: commitSha.trim(),
    subject: subject.trim(),
    authorName: authorName.trim(),
    authorEmail: authorEmail.trim(),
    timestamp: +timestamp.trim() || 0,
    body,
  };
}

Domain

Subdomains

Frequently Asked Questions

What does loadCommitDetails() do?
loadCommitDetails() is a function in the react codebase, defined in scripts/tasks/generate-changelog/data.js.
Where is loadCommitDetails() defined?
loadCommitDetails() is defined in scripts/tasks/generate-changelog/data.js at line 85.

Analyze Your Own Codebase

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

Try Supermodel Free