{"record":{"id":"c1165f02c9c6c707","repo":"phacility/phabricator","slug":"flags-all-identities-and-raw-are-not-compa","errorCode":null,"errorMessage":"Flags \"--all-identities\" and \"--raw\" are not compatible.","messagePattern":"Flags \"--all-identities\" and \"--raw\" are not compatible\\.","errorType":"exception","errorClass":"PhutilArgumentUsageException","httpStatus":null,"severity":"warning","filePath":"src/applications/repository/management/PhabricatorRepositoryManagementRebuildIdentitiesWorkflow.php","lineNumber":83,"sourceCode":"\n    $rebuilt_anything = false;\n\n    $all_repositories = $args->getArg('all-repositories');\n    $repositories = $args->getArg('repository');\n\n    if ($all_repositories && $repositories) {\n      throw new PhutilArgumentUsageException(\n        pht(\n          'Flags \"--all-repositories\" and \"--repository\" are not '.\n          'compatible.'));\n    }\n\n\n    $all_identities = $args->getArg('all-identities');\n    $raw = $args->getArg('raw');\n\n    if ($all_identities && $raw) {\n      throw new PhutilArgumentUsageException(\n        pht(\n          'Flags \"--all-identities\" and \"--raw\" are not '.\n          'compatible.'));\n    }\n\n    $dry_run = $args->getArg('dry-run');\n    $this->dryRun = $dry_run;\n\n    if ($this->dryRun) {\n      $this->logWarn(\n        pht('DRY RUN'),\n        pht('This is a dry run, so no changes will be written.'));\n    }\n\n    if ($all_repositories || $repositories) {\n      $rebuilt_anything = true;\n\n      if ($repositories) {","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/repository/management/PhabricatorRepositoryManagementRebuildIdentitiesWorkflow.php#L65-L101","documentation":"In `bin/repository rebuild-identities`, `--all-identities` rebuilds every existing identity while `--raw` selects identities by their exact raw identity string. Both flags given together is contradictory (select-all plus explicit selection), so the workflow rejects the combination up front with this PhutilArgumentUsageException.","triggerScenarios":"Running `./bin/repository rebuild-identities --all-identities --raw 'Alice <alice@example.com>'` or any invocation where both `--all-identities` and `--raw` are truthy.","commonSituations":"Operator history reuse; wrapper scripts that always set `--all-identities` and also forward explicit raw strings when a user supplies them.","solutions":["Drop `--raw` to rebuild all identities, or drop `--all-identities` and pass only the exact raw strings you need.","Make wrapper logic pick one mode: bulk rebuild or targeted rebuild, never both."],"exampleFix":"# before\n./bin/repository rebuild-identities --all-identities --raw 'Alice <alice@example.com>'\n\n# after: targeted rebuild only\n./bin/repository rebuild-identities --raw 'Alice <alice@example.com>'\n# or bulk rebuild only\n./bin/repository rebuild-identities --all-identities","handlingStrategy":"validation","validationCode":"# Shell guard before invoking rebuild-identities\nif [ -n \"$RAW\" ] && [ \"$ALL_IDS\" = \"1\" ]; then\n  echo \"--raw and --all-identities are mutually exclusive\" >&2\n  exit 2\nfi\n./bin/repository rebuild-identities ${RAW:+--raw \"$RAW\"} ${ALL_IDS:+--all-identities}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Model identity rebuild invocations as one of two modes (bulk vs exact strings) and validate the mode before running.","Prefer `--all-identities` in automation; reserve `--raw` for targeted manual runs."],"tags":["php","phabricator","cli","flags","rebuild-identities","usage-error"],"backgroundTag":"mutually-exclusive-flags","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}