{"record":{"id":"e8d2e130e1707aaf","repo":"phacility/phabricator","slug":"nothing-specified-to-rebuild-use-flags-to-choose","errorCode":null,"errorMessage":"Nothing specified to rebuild. Use flags to choose which identities to rebuild, or \"--help\" for help.","messagePattern":"Nothing specified to rebuild\\. Use flags to choose which identities to rebuild, or \"--help\" for help\\.","errorType":"exception","errorClass":"PhutilArgumentUsageException","httpStatus":null,"severity":"warning","filePath":"src/applications/repository/management/PhabricatorRepositoryManagementRebuildIdentitiesWorkflow.php","lineNumber":191,"sourceCode":"        }\n\n        $identity_list = $identities;\n      } else {\n        $identity_query = id(new PhabricatorRepositoryIdentityQuery())\n          ->setViewer($viewer);\n\n        $identity_list = new PhabricatorQueryIterator($identity_query);\n\n        $this->logInfo(\n          pht('REBUILD'),\n          pht('Rebuilding all existing identities.'));\n      }\n\n      $this->rebuildIdentities($identity_list);\n    }\n\n    if (!$rebuilt_anything) {\n      throw new PhutilArgumentUsageException(\n        pht(\n          'Nothing specified to rebuild. Use flags to choose which '.\n          'identities to rebuild, or \"--help\" for help.'));\n    }\n\n    return 0;\n  }\n\n  private function rebuildCommits($commits) {\n    foreach ($commits as $commit) {\n      $needs_update = false;\n\n      $data = $commit->getCommitData();\n      $author = $data->getAuthorString();\n\n      $author_identity = $this->getIdentityForCommit(\n        $commit,\n        $author);","sourceCodeStart":173,"sourceCodeEnd":209,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/repository/management/PhabricatorRepositoryManagementRebuildIdentitiesWorkflow.php#L173-L209","documentation":"rebuild-identities does nothing unless a selector flag is given: `--repository`, `--all-repositories`, `--all-identities`, or `--raw`. The workflow tracks $rebuilt_anything and, when no branch of the selection logic ran, exits with this PhutilArgumentUsageException telling the operator to choose a target.","triggerScenarios":"Bare `./bin/repository rebuild-identities` with no flags, or a combination where every flag is falsy (e.g. `--repository` passed an empty value).","commonSituations":"Running the new command to 'see what it does'; automation that builds the command line dynamically and ends up with all selectors empty.","solutions":["Add at least one selector: `--repository R` to scope to a repository, `--all-repositories` for all of them, or `--all-identities` / `--raw <string>` to pick identities directly.","Run `./bin/repository rebuild-identities --help` to review the available selectors before composing the command.","Prepend `--dry-run` while experimenting so the command validates arguments without writing."],"exampleFix":"# before\n./bin/repository rebuild-identities\n# Usage exception: Nothing specified to rebuild...\n\n# after\n./bin/repository rebuild-identities --repository R --dry-run","handlingStrategy":"validation","validationCode":"# Require at least one selector before invoking\n[ -n \"$REPO\" ] || [ \"$ALL_REPOS\" = 1 ] || [ \"$ALL_IDS\" = 1 ] || [ -n \"$RAW\" ] || {\n  echo \"rebuild-identities needs a selector flag\" >&2; exit 2;\n}\n./bin/repository rebuild-identities ${REPO:+--repository \"$REPO\"} ${ALL_REPOS:+--all-repositories} ${ALL_IDS:+--all-identities} ${RAW:+--raw \"$RAW\"}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Make wrapper scripts fail fast when no selector is configured.","Use `--dry-run` while composing the command to validate flags without side effects."],"tags":["php","phabricator","cli","rebuild-identities","usage-error"],"backgroundTag":"missing-cli-argument","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}