phacility/phabricator · warning · PhutilArgumentUsageException

Specify a commit or repository to reparse, not both: All fro

Error message

Specify a commit or repository to reparse, not both:
All from repo: %s
Commit(s) to reparse: %s

What it means

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.

Source

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

    $all_from_repo = $args->getArg('all');
    $reparse_message = $args->getArg('message');
    $reparse_change = $args->getArg('change');
    $reparse_publish = $args->getArg('publish');
    $reparse_what = $args->getArg('revision');
    $force = $args->getArg('force');
    $background = $args->getArg('background');
    $min_date = $args->getArg('min-date');
    $importing = $args->getArg('importing');

    if (!$all_from_repo && !$reparse_what) {
      throw new PhutilArgumentUsageException(
        pht('Specify a commit or repository to reparse.'));
    }

    if ($all_from_repo && $reparse_what) {
      $commits = implode(', ', $reparse_what);
      throw new PhutilArgumentUsageException(
        pht(
          "Specify a commit or repository to reparse, not both:\n".
          "All from repo: %s\n".
          "Commit(s) to reparse: %s",
          $all_from_repo,
          $commits));
    }

    $any_step = ($reparse_message || $reparse_change || $reparse_publish);

    if ($any_step && $importing) {
      throw new PhutilArgumentUsageException(
        pht(
          'Choosing steps with "--importing" conflicts with flags which '.
          'select specific steps.'));
    } else if ($any_step) {
      // OK.
    } else if ($importing) {

View on GitHub (pinned to 5720a38cfe)

Solutions

  1. Pick one mode: remove the commit identifiers for a whole-repository reparse, or remove `--all` to reparse just the listed commits.
  2. Validate in wrappers that `--all` and positional commits are never emitted together.

Example fix

# before
./bin/repository reparse --all R abc1234 --change
# Usage exception: Specify a commit or repository to reparse, not both:
# All from repo: R
# Commit(s) to reparse: abc1234

# after: whole repository
./bin/repository reparse --all R --change
# or just the commit
./bin/repository reparse abc1234 --change
Defensive patterns

Strategy: validation

Validate before calling

# Reject the contradictory combination up front
if [ -n "$ALL" ] && [ $# -gt 0 ]; then
  echo "pass either --all or explicit commits, not both" >&2; exit 2
fi
./bin/repository reparse ${ALL:+--all "$ALL"} "$@" --change

Prevention

When it happens

Trigger: Running `./bin/repository reparse --all R <commit-identifier>` — any invocation where `$all_from_repo` and `$reparse_what` are both truthy.

Common situations: Shell history reuse appending a commit hash onto a whole-repo command; scripts that default to `--all` and also forward user-supplied commits.

Related errors


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