{"record":{"id":"ab0649a2f2825e35","repo":"phacility/phabricator","slug":"specify-a-commit-or-repository-to-reparse-not-bot","errorCode":null,"errorMessage":"Specify a commit or repository to reparse, not both:\nAll from repo: %s\nCommit(s) to reparse: %s","messagePattern":"Specify a commit or repository to reparse, not both:\nAll from repo: (.+?)\nCommit\\(s\\) to reparse: (.+?)","errorType":"exception","errorClass":"PhutilArgumentUsageException","httpStatus":null,"severity":"warning","filePath":"src/applications/repository/management/PhabricatorRepositoryManagementReparseWorkflow.php","lineNumber":101,"sourceCode":"\n    $all_from_repo = $args->getArg('all');\n    $reparse_message = $args->getArg('message');\n    $reparse_change = $args->getArg('change');\n    $reparse_publish = $args->getArg('publish');\n    $reparse_what = $args->getArg('revision');\n    $force = $args->getArg('force');\n    $background = $args->getArg('background');\n    $min_date = $args->getArg('min-date');\n    $importing = $args->getArg('importing');\n\n    if (!$all_from_repo && !$reparse_what) {\n      throw new PhutilArgumentUsageException(\n        pht('Specify a commit or repository to reparse.'));\n    }\n\n    if ($all_from_repo && $reparse_what) {\n      $commits = implode(', ', $reparse_what);\n      throw new PhutilArgumentUsageException(\n        pht(\n          \"Specify a commit or repository to reparse, not both:\\n\".\n          \"All from repo: %s\\n\".\n          \"Commit(s) to reparse: %s\",\n          $all_from_repo,\n          $commits));\n    }\n\n    $any_step = ($reparse_message || $reparse_change || $reparse_publish);\n\n    if ($any_step && $importing) {\n      throw new PhutilArgumentUsageException(\n        pht(\n          'Choosing steps with \"--importing\" conflicts with flags which '.\n          'select specific steps.'));\n    } else if ($any_step) {\n      // OK.\n    } else if ($importing) {","sourceCodeStart":83,"sourceCodeEnd":119,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/repository/management/PhabricatorRepositoryManagementReparseWorkflow.php#L83-L119","documentation":"The two selection modes of `bin/repository reparse` are mutually exclusive: `--all <repository>` (whole repository) and explicit commit identifiers in the wildcard arguments. Supplying both makes the intent ambiguous, so the workflow reports both values (`All from repo` and `Commit(s) to reparse`) and aborts with this PhutilArgumentUsageException.","triggerScenarios":"Running `./bin/repository reparse --all R <commit-identifier>` — any invocation where `$all_from_repo` and `$reparse_what` are both truthy.","commonSituations":"Shell history reuse appending a commit hash onto a whole-repo command; scripts that default to `--all` and also forward user-supplied commits.","solutions":["Pick one mode: remove the commit identifiers for a whole-repository reparse, or remove `--all` to reparse just the listed commits.","Validate in wrappers that `--all` and positional commits are never emitted together."],"exampleFix":"# before\n./bin/repository reparse --all R abc1234 --change\n# Usage exception: Specify a commit or repository to reparse, not both:\n# All from repo: R\n# Commit(s) to reparse: abc1234\n\n# after: whole repository\n./bin/repository reparse --all R --change\n# or just the commit\n./bin/repository reparse abc1234 --change","handlingStrategy":"validation","validationCode":"# Reject the contradictory combination up front\nif [ -n \"$ALL\" ] && [ $# -gt 0 ]; then\n  echo \"pass either --all or explicit commits, not both\" >&2; exit 2\nfi\n./bin/repository reparse ${ALL:+--all \"$ALL\"} \"$@\" --change","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Encode the either/or rule in scripts that forward user-provided commits plus a default `--all`.","Prefer `--all` for bulk maintenance and bare commits for surgical fixes."],"tags":["php","phabricator","cli","reparse","flags","usage-error"],"backgroundTag":"mutually-exclusive-flags","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}