Skip to content

Commit 3c4cdbc

Browse files
weaverryannicolas-grekas
authored andcommitted
showing commit history for entire recipe - not just specific version
1 parent 1aa8816 commit 3c4cdbc

File tree

1 file changed

+18
-20
lines changed

1 file changed

+18
-20
lines changed

src/Command/RecipesCommand.php

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -183,23 +183,19 @@ private function displayPackageInformation(Recipe $recipe)
183183
if ($lockRef !== $recipe->getRef()) {
184184
$io->write('<info>latest recipe</info> : '.$recipe->getURL());
185185

186-
// if the version is the same, point them to the history
187-
if ($recipe->getVersion() === $recipeLock['version'] && null !== $gitSha) {
188-
$historyUrl = sprintf(
189-
'https://%s/commits/%s/%s/%s',
190-
$lockRepo,
191-
$branch,
192-
$recipe->getName(),
193-
$recipe->getVersion()
194-
);
195-
196-
// show commits since one second after the currently-installed recipe
197-
if (null !== $commitDate) {
198-
$historyUrl .= '?since='.(new \DateTime($commitDate))->modify('+1 seconds')->format('c\Z');
199-
}
186+
$historyUrl = sprintf(
187+
'https://%s/commits/%s/%s',
188+
$lockRepo,
189+
$branch,
190+
$recipe->getName()
191+
);
200192

201-
$io->write('<info>new commits</info> : '.$historyUrl);
193+
// show commits since one second after the currently-installed recipe
194+
if (null !== $commitDate) {
195+
$historyUrl .= '?since='.(new \DateTime($commitDate))->modify('+1 seconds')->format('c\Z');
202196
}
197+
198+
$io->write('<info>recipe history</info> : '.$historyUrl);
203199
}
204200

205201
if (null !== $lockFiles) {
@@ -211,11 +207,13 @@ private function displayPackageInformation(Recipe $recipe)
211207
$this->displayFilesTree($tree);
212208
}
213209

214-
$io->write([
215-
'',
216-
'Update this recipe by running:',
217-
sprintf('<info>composer recipes:install %s --force -v</info>', $recipe->getName()),
218-
]);
210+
if ($lockRef !== $recipe->getRef()) {
211+
$io->write([
212+
'',
213+
'Update this recipe by running:',
214+
sprintf('<info>composer recipes:install %s --force -v</info>', $recipe->getName()),
215+
]);
216+
}
219217
}
220218

221219
private function generateFilesTree(array $files): array

0 commit comments

Comments
 (0)