{"record":{"id":"8cc786470c5e369c","repo":"phacility/phabricator","slug":"no-commits-have-been-discovered-in-the-s-reposi","errorCode":null,"errorMessage":"No commits have been discovered in the \"%s\" repository!","messagePattern":"No commits have been discovered in the \"(.+?)\" repository!","errorType":"exception","errorClass":"PhutilArgumentUsageException","httpStatus":null,"severity":"warning","filePath":"src/applications/repository/management/PhabricatorRepositoryManagementReparseWorkflow.php","lineNumber":175,"sourceCode":"          pht('Unknown repository \"%s\"!', $all_from_repo));\n      }\n\n      $query = id(new DiffusionCommitQuery())\n        ->setViewer(PhabricatorUser::getOmnipotentUser())\n        ->withRepository($repository);\n\n      if ($min_timestamp) {\n        $query->withEpochRange($min_timestamp, null);\n      }\n\n      if ($importing) {\n        $query->withImporting(true);\n      }\n\n      $commits = $query->execute();\n\n      if (!$commits) {\n        throw new PhutilArgumentUsageException(\n          pht(\n            'No commits have been discovered in the \"%s\" repository!',\n            $repository->getDisplayName()));\n      }\n    } else {\n      $commits = $this->loadNamedCommits($reparse_what);\n    }\n\n    if (!$background) {\n      PhabricatorWorker::setRunAllTasksInProcess(true);\n    }\n\n    $progress = new PhutilConsoleProgressBar();\n    $progress->setTotal(count($commits));\n\n    $tasks = array();\n    foreach ($commits as $commit) {\n      $repository = $commit->getRepository();","sourceCodeStart":157,"sourceCodeEnd":193,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/repository/management/PhabricatorRepositoryManagementReparseWorkflow.php#L157-L193","documentation":"After loading the repository, reparse runs a DiffusionCommitQuery (optionally filtered by `--min-date` epoch range and `--importing`) and requires a non-empty commit set. A repository with zero discovered commits — or where every commit is excluded by the filters — raises this PhutilArgumentUsageException.","triggerScenarios":"`--all R` on a brand-new repository whose discovery has not run or found anything yet; `--min-date` set after the newest commit so the epoch filter excludes everything; `--importing` on a fully imported repository where nothing matches.","commonSituations":"Reparse immediately after creating a repository before the daemons discover commits; overly recent `--min-date` values; `--importing` used as a no-op check on finished imports.","solutions":["Confirm the repository actually has commits in Diffusion (or repository_commit rows); if empty, run `./bin/repository discover R` and `./bin/repository pull R` first.","Loosen or remove `--min-date` so the epoch range includes existing commits.","Drop `--importing` when the repository is fully imported, since nothing will match that filter."],"exampleFix":"# before\n./bin/repository reparse --all R --importing   # R fully imported already\n# Usage exception: No commits have been discovered in the \"R\" repository!\n\n# after: either discover new commits first, or target specific steps without --importing\n./bin/repository discover R && ./bin/repository reparse --all R --importing\n./bin/repository reparse --all R --message","handlingStrategy":"validation","validationCode":"# Check the repository has commits (and importing ones if using --importing) first\ncount=$(mysql -N -B phabricator_repository -e \\\n  \"SELECT COUNT(*) FROM repository_commit WHERE repositoryID = <id>\")\n[ \"$count\" -gt 0 ] || { echo \"no commits discovered yet; run discover\" >&2; exit 1; }\n./bin/repository discover R\n./bin/repository reparse --all R --importing","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run `discover` before `reparse --all` on newly created repositories.","Remember `--min-date` and `--importing` are filters: if they exclude every commit, the command fails even on a populated repository."],"tags":["php","phabricator","cli","reparse","empty-result","repository-import"],"backgroundTag":"repository-has-no-commits","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}