Skip to content

Commit

Permalink
Merge pull request #234 from dxw/chore/always-describe-most-detailed-…
Browse files Browse the repository at this point in the history
…semver-version

whippet deps describe shows the most detailed semver version
  • Loading branch information
snim2 authored Jan 19, 2024
2 parents 44f42aa + 8c30725 commit 0a2417f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed
- `whippet generate app` generates an app which can be deployed by Whippet.
- `whippet deps describe` always prints the most detailed semver version available.

### Added
- Support for PHP 8
Expand Down
4 changes: 4 additions & 0 deletions src/Git/Git.php
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,10 @@ public static function tag_for_commit($repo, $commit_hash)
return \Result\Result::ok('No tags for commit ' . $commit_hash);
}

usort($tags_array, function ($a, $b) {
return strlen($b) <=> strlen($a);
});

$resultArray = explode('/', $tags_array[0]);
$result = str_replace("^{}", "", end($resultArray));

Expand Down

0 comments on commit 0a2417f

Please sign in to comment.