{"record":{"id":"acb99727aa7676bf","repo":"phacility/phabricator","slug":"you-must-use-all-if-you-specify-min-date","errorCode":null,"errorMessage":"You must use \"--all\" if you specify \"--min-date\".","messagePattern":"You must use \"--all\" if you specify \"--min-date\"\\.","errorType":"exception","errorClass":"PhutilArgumentUsageException","httpStatus":null,"severity":"warning","filePath":"src/applications/repository/management/PhabricatorRepositoryManagementReparseWorkflow.php","lineNumber":133,"sourceCode":"          '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\n      if (!$all_from_repo) {\n        throw new PhutilArgumentUsageException(\n          pht(\n            'You must use \"--all\" if you specify \"--min-date\".'));\n      }\n\n      // previous to PHP 5.1.0 you would compare with -1, instead of false\n      if (false === $min_timestamp) {\n        throw new PhutilArgumentUsageException(\n          pht(\n            \"Supplied --min-date is not valid. See help for valid examples.\\n\".\n            \"Supplied value: '%s'\\n\",\n            $min_date));\n      }\n    }\n\n    $commits = array();\n    if ($all_from_repo) {\n      $repository = id(new PhabricatorRepositoryQuery())\n        ->setViewer(PhabricatorUser::getOmnipotentUser())","sourceCodeStart":115,"sourceCodeEnd":151,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/repository/management/PhabricatorRepositoryManagementReparseWorkflow.php#L115-L151","documentation":"In reparse, `--min-date` restricts a whole-repository reparse to commits committed after a timestamp. Because it filters the DiffusionCommitQuery built only on the `--all` path, using `--min-date` without `--all` is invalid and rejected with this PhutilArgumentUsageException before any query runs.","triggerScenarios":"Running `./bin/repository reparse <commit> --min-date '2020-01-01'` — `$min_date` truthy while `$all_from_repo` is false.","commonSituations":"Pasting a date filter onto a commit-targeted command; scripts with a configurable date option that omit `--all` for single-commit runs.","solutions":["Switch to whole-repository mode: `./bin/repository reparse --all R --min-date '<date>' --<step>`.","If you only need specific commits, drop `--min-date` and list the commit identifiers directly."],"exampleFix":"# before\n./bin/repository reparse abc1234 --change --min-date '2020-01-01'\n# Usage exception: You must use \"--all\" if you specify \"--min-date\".\n\n# after\n./bin/repository reparse --all R --change --min-date '2020-01-01'","handlingStrategy":"validation","validationCode":"# Enforce the --min-date requires --all rule in the wrapper\nif [ -n \"$MIN_DATE\" ] && [ -z \"$ALL\" ]; then\n  echo \"--min-date requires --all <repository>\" >&2; exit 2\nfi\n./bin/repository reparse ${ALL:+--all \"$ALL\"} ${MIN_DATE:+--min-date \"$MIN_DATE\"} --change","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only attach date filters to whole-repository reparses.","For single commits, filter upstream by generating the commit list yourself."],"tags":["php","phabricator","cli","reparse","flags","usage-error"],"backgroundTag":"flag-requires-another-flag","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}