{"record":{"id":"75066528c8abc332","repo":"angular/angular-cli","slug":"failed-to-look-up-hash-of-most-recent-commit-co","errorCode":null,"errorMessage":"  Failed to look up hash of most recent commit, continuing anyways.","messagePattern":"  Failed to look up hash of most recent commit, continuing anyways\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/angular/cli/src/commands/update/utilities/migration.ts","lineNumber":304,"sourceCode":"    createCommit(message);\n  } catch (err) {\n    logger.error(\n      `Failed to commit update (${message}):\\n${(err as SpawnSyncReturns<string>).stderr}`,\n    );\n\n    return false;\n  }\n\n  // Notify user of the commit.\n  const hash = findCurrentGitSha();\n  const shortMessage = message.split('\\n')[0];\n  if (hash) {\n    logger.info(`  Committed migration step (${getShortHash(hash)}): ${shortMessage}.`);\n  } else {\n    // Commit was successful, but reading the hash was not. Something weird happened,\n    // but nothing that would stop the update. Just log the weirdness and continue.\n    logger.info(`  Committed migration step: ${shortMessage}.`);\n    logger.warn('  Failed to look up hash of most recent commit, continuing anyways.');\n  }\n\n  return true;\n}\n\nasync function getOptionalMigrationsToRun(\n  logger: logging.Logger,\n  optionalMigrations: MigrationSchematicDescription[],\n  packageName: string,\n): Promise<MigrationSchematicDescription[] | undefined> {\n  const numberOfMigrations = optionalMigrations.length;\n  logger.info(\n    `This package has ${numberOfMigrations} optional migration${\n      numberOfMigrations > 1 ? 's' : ''\n    } that can be executed.`,\n  );\n\n  if (!isTTY()) {","sourceCodeStart":286,"sourceCodeEnd":322,"githubUrl":"https://github.com/angular/angular-cli/blob/bb72145f9ab45aee29f523236b3a25cd0813a841/packages/angular/cli/src/commands/update/utilities/migration.ts#L286-L322","documentation":"After a migration step is committed to git, the Angular CLI tries to read the new commit's hash to log it. If the hash lookup fails (e.g. unusual git state), the CLI warns that it could not read the hash but continues, since the commit itself succeeded and nothing blocks the update.","triggerScenarios":"Running `ng update` with migrations; `commitChanges` performs `git commit` successfully but the subsequent hash lookup (e.g. `git rev-parse`) returns no hash — typically due to a non-standard git repo, git hooks modifying the commit, or a git version/environment quirk.","commonSituations":"Updating Angular packages in workspaces with git hooks (husky/lint-staged) that amend commits, shallow or worktree clones, or repos where git output parsing fails.","solutions":["No action strictly required — the migration step was committed and the update continues; this is informational.","Verify the migration commits exist with `git log` and check that `git rev-parse HEAD` works in the repo.","Temporarily disable git hooks (e.g. `HUSKY=0` or `--no-verify` behavior) and re-run `ng update` if hashes are repeatedly unreadable."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"// before ng update\ngit rev-parse HEAD && git status --porcelain  # ensure repo is healthy and clean\ngit log -1 --format=%H  # confirm hash lookup works in this repo","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run `ng update` in a clean, healthy git repo (no hooks rewriting commits).","Disable commit hooks (husky/lint-staged) during migrations.","After update, verify migration commits exist via `git log`."],"tags":["git","migration","angular-cli","update"],"backgroundTag":"git-commit-hash-lookup-failed","analyzedSha":"bb72145f9ab45aee29f523236b3a25cd0813a841","analyzedAt":"2026-08-30T02:47:34.745Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}