{"record":{"id":"1e01f5dfe95a420c","repo":"phacility/phabricator","slug":"choosing-steps-with-importing-conflicts-with-f","errorCode":null,"errorMessage":"Choosing steps with \"--importing\" conflicts with flags which select specific steps.","messagePattern":"Choosing steps with \"--importing\" conflicts with flags which select specific steps\\.","errorType":"exception","errorClass":"PhutilArgumentUsageException","httpStatus":null,"severity":"warning","filePath":"src/applications/repository/management/PhabricatorRepositoryManagementReparseWorkflow.php","lineNumber":113,"sourceCode":"      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) {\n      // OK.\n    } else if (!$any_step && !$importing) {\n      throw new PhutilArgumentUsageException(\n        pht(\n          'Specify which steps to reparse with \"--message\", \"--change\", '.\n          'and/or \"--publish\"; or \"--importing\" to run all missing steps.'));\n    }\n\n    $min_timestamp = false;\n    if ($min_date) {\n      $min_timestamp = strtotime($min_date);\n","sourceCodeStart":95,"sourceCodeEnd":131,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/repository/management/PhabricatorRepositoryManagementReparseWorkflow.php#L95-L131","documentation":"reparse offers two ways to choose what runs: explicit step flags (`--message`, `--change`, `--publish`) or `--importing`, which runs every step a commit has not completed yet. Combining `--importing` with specific step flags is contradictory — the 'missing steps' set cannot be narrowed to hand-picked steps — so the combination is rejected with this PhutilArgumentUsageException.","triggerScenarios":"Running `./bin/repository reparse --all R --importing --message` or any invocation where `$any_step` (message/change/publish) is truthy together with `--importing`.","commonSituations":"Operators adding `--importing` to an existing step-specific command hoping to 'fill in the rest'; copied command lines from runbooks that mixed guidance from both modes.","solutions":["For targeted work, drop `--importing` and keep the specific step flags (`--message`, `--change`, `--publish`, combinable).","For catch-up work on partially imported commits, drop the step flags and keep only `--importing`."],"exampleFix":"# before\n./bin/repository reparse --all R --importing --message\n# Usage exception: Choosing steps with \"--importing\" conflicts with flags which select specific steps.\n\n# after: run all missing steps\n./bin/repository reparse --all R --importing\n# or run one specific step everywhere\n./bin/repository reparse --all R --message","handlingStrategy":"validation","validationCode":"# Reject --importing combined with step flags before invoking\nif [ \"$IMPORTING\" = 1 ] && { [ \"$MSG\" = 1 ] || [ \"$CHANGE\" = 1 ] || [ \"$PUBLISH\" = 1 ]; }; then\n  echo \"--importing cannot be combined with --message/--change/--publish\" >&2; exit 2\nfi\n./bin/repository reparse --all \"$REPO\" ${MSG:+--message} ${CHANGE:+--change} ${PUBLISH:+--publish} ${IMPORTING:+--importing}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Document the two modes (catch-up vs targeted) prominently in internal runbooks.","Have scripts select one mode explicitly and refuse mixed configurations."],"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"}