{"record":{"id":"9f6c07f4d7dba52d","repo":"phacility/phabricator","slug":"specify-one-or-more-repositories-to-update-refs-fo","errorCode":null,"errorMessage":"Specify one or more repositories to update refs for.","messagePattern":"Specify one or more repositories to update refs for\\.","errorType":"exception","errorClass":"PhutilArgumentUsageException","httpStatus":null,"severity":"warning","filePath":"src/applications/repository/management/PhabricatorRepositoryManagementRefsWorkflow.php","lineNumber":34,"sourceCode":"          ),\n          array(\n            'name' => 'rebuild',\n            'help' => pht(\n              'Publish commits currently reachable from any permanent ref, '.\n              'ignoring the cached ref state.'),\n          ),\n          array(\n            'name'        => 'repos',\n            'wildcard'    => true,\n          ),\n        ));\n  }\n\n  public function execute(PhutilArgumentParser $args) {\n    $repos = $this->loadLocalRepositories($args, 'repos');\n\n    if (!$repos) {\n      throw new PhutilArgumentUsageException(\n        pht(\n          'Specify one or more repositories to update refs for.'));\n    }\n\n    $console = PhutilConsole::getConsole();\n    foreach ($repos as $repo) {\n      $console->writeOut(\n        \"%s\\n\",\n        pht(\n          'Updating refs in \"%s\"...',\n          $repo->getDisplayName()));\n\n      $engine = id(new PhabricatorRepositoryRefEngine())\n        ->setRepository($repo)\n        ->setVerbose($args->getArg('verbose'))\n        ->setRebuild($args->getArg('rebuild'))\n        ->updateRefs();\n    }","sourceCodeStart":16,"sourceCodeEnd":52,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/repository/management/PhabricatorRepositoryManagementRefsWorkflow.php#L16-L52","documentation":"`bin/repository refs` refreshes ref cursors (branch/tag positions) for the given repositories. The wildcard `repos` arguments are resolved via loadLocalRepositories() to repositories hosted on this device; an empty selection aborts with this PhutilArgumentUsageException before any ref update runs.","triggerScenarios":"Executing `./bin/repository refs` with no arguments; passing callsigns that match no locally-hosted repository; running on a host that hosts no working copies.","commonSituations":"Manual refresh on the wrong cluster node; typo'd callsign; a freshly added repository whose working copy has not been created on this device yet.","solutions":["Pass an explicit target: `./bin/repository refs XYZ`.","Confirm the callsign with `./bin/repository list-repositories`.","Run the command on the device that hosts the repository's working copy."],"exampleFix":"# before\n./bin/repository refs\n# Usage exception: Specify one or more repositories to update refs for.\n\n# after\n./bin/repository refs XYZ","handlingStrategy":"validation","validationCode":"# Confirm the callsign exists and the working copy is on this host\n./bin/repository list-repositories | grep -q \"^R<callsign>\" || exit 1\nls \"/var/repo/<callsign>\" >/dev/null 2>&1 || { echo \"not hosted here\" >&2; exit 1; }\n./bin/repository refs <callsign>","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pass explicit callsigns to `refs` in automation.","Run ref refreshes on the device that hosts the repository."],"tags":["php","phabricator","cli","refs","usage-error"],"backgroundTag":"missing-cli-argument","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}