Skip to content

Instantly share code, notes, and snippets.

@Roguelazer
Last active April 25, 2020 01:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Roguelazer/5471fbe79a2280ed7af3822c275fff5a to your computer and use it in GitHub Desktop.
Save Roguelazer/5471fbe79a2280ed7af3822c275fff5a to your computer and use it in GitHub Desktop.
--- src/toolset/workflow/ArcanistVersionWorkflow.php.orig 2020-04-24 18:03:45.000000000 -0700
+++ src/toolset/workflow/ArcanistVersionWorkflow.php 2020-04-24 18:17:51.000000000 -0700
@@ -46,35 +46,17 @@
$roots = array(
'arcanist' => dirname(phutil_get_library_root('arcanist')),
);
foreach ($roots as $lib => $root) {
- $working_copy = ArcanistWorkingCopy::newFromWorkingDirectory($root);
-
- $repository_api = $working_copy->getRepositoryAPI();
- $is_git = ($repository_api instanceof ArcanistGitAPI);
-
- if (!$is_git) {
- throw new PhutilArgumentUsageException(
- pht(
- 'Library "%s" (at "%s") is not a Git working copy, so no version '.
- 'information can be provided.',
- $lib,
- Filesystem::readablePath($root)));
- }
-
- list($commit) = $repository_api->execxLocal(
- 'log -1 --format=%s',
- '%ct%x01%H');
- $commit = trim($commit);
-
- list($timestamp, $commit) = explode("\1", $commit);
+ $commit = Filesystem::readFile($root . "/VERSION");
$console->writeOut(
"%s %s (%s)\n",
$lib,
$commit,
- date('j M Y', (int)$timestamp));
+ 'unknown'
+ );
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment