dirname(phutil_get_library_root('arcanist')), 'libphutil' => dirname(phutil_get_library_root('phutil')), ); foreach ($roots as $lib => $root) { $working_copy = ArcanistWorkingCopyIdentity::newFromPath($root); $configuration_manager = clone $this->getConfigurationManager(); $configuration_manager->setWorkingCopyIdentity($working_copy); $repository = ArcanistRepositoryAPI::newAPIFromConfigurationManager( $configuration_manager); if (!Filesystem::pathExists($repository->getMetadataPath())) { throw new ArcanistUsageException( pht('%s is not a git working copy.', $lib)); } // NOTE: Carefully execute these commands in a way that works on Windows // until T8298 is properly fixed. See PHI52. list($commit) = $repository->execxLocal('log -1 --format=%%H'); $commit = trim($commit); list($timestamp) = $repository->execxLocal('log -1 --format=%%ct'); $timestamp = trim($timestamp); $console->writeOut( "%s %s (%s)\n", $lib, $commit, date('j M Y', (int)$timestamp)); } } }