phacility/phabricator · warning · PhutilArgumentUsageException

You must use "--all" if you specify "--min-date".

Error message

You must use "--all" if you specify "--min-date".

What it means

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.

Source

Thrown at src/applications/repository/management/PhabricatorRepositoryManagementReparseWorkflow.php:133

          'Choosing steps with "--importing" conflicts with flags which '.
          'select specific steps.'));
    } else if ($any_step) {
      // OK.
    } else if ($importing) {
      // OK.
    } else if (!$any_step && !$importing) {
      throw new PhutilArgumentUsageException(
        pht(
          'Specify which steps to reparse with "--message", "--change", '.
          'and/or "--publish"; or "--importing" to run all missing steps.'));
    }

    $min_timestamp = false;
    if ($min_date) {
      $min_timestamp = strtotime($min_date);

      if (!$all_from_repo) {
        throw new PhutilArgumentUsageException(
          pht(
            'You must use "--all" if you specify "--min-date".'));
      }

      // previous to PHP 5.1.0 you would compare with -1, instead of false
      if (false === $min_timestamp) {
        throw new PhutilArgumentUsageException(
          pht(
            "Supplied --min-date is not valid. See help for valid examples.\n".
            "Supplied value: '%s'\n",
            $min_date));
      }
    }

    $commits = array();
    if ($all_from_repo) {
      $repository = id(new PhabricatorRepositoryQuery())
        ->setViewer(PhabricatorUser::getOmnipotentUser())

View on GitHub (pinned to 5720a38cfe)

Solutions

  1. Switch to whole-repository mode: `./bin/repository reparse --all R --min-date '<date>' --<step>`.
  2. If you only need specific commits, drop `--min-date` and list the commit identifiers directly.

Example fix

# before
./bin/repository reparse abc1234 --change --min-date '2020-01-01'
# Usage exception: You must use "--all" if you specify "--min-date".

# after
./bin/repository reparse --all R --change --min-date '2020-01-01'
Defensive patterns

Strategy: validation

Validate before calling

# Enforce the --min-date requires --all rule in the wrapper
if [ -n "$MIN_DATE" ] && [ -z "$ALL" ]; then
  echo "--min-date requires --all <repository>" >&2; exit 2
fi
./bin/repository reparse ${ALL:+--all "$ALL"} ${MIN_DATE:+--min-date "$MIN_DATE"} --change

Prevention

When it happens

Trigger: Running `./bin/repository reparse <commit> --min-date '2020-01-01'` — `$min_date` truthy while `$all_from_repo` is false.

Common situations: Pasting a date filter onto a commit-targeted command; scripts with a configurable date option that omit `--all` for single-commit runs.

Related errors


AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21). Data as JSON: /api/errors/acb99727aa7676bf. Report an issue: GitHub.