shivas / versioning-bundle

Simple way to version (semantic versioning 2.0.0) your Symfony2/3/4/5/6 application
MIT License
111 stars 30 forks source link

Adding option to GitRepositoryProvider ? #89

Closed VincentLanglet closed 1 year ago

VincentLanglet commented 1 year ago

Hi @shivas, @dontub Thanks for this useful bundle.

I got recently an issue with the GitRepositoryProvider,

Our workflow is the following:

The issue is that in development environment, since our git branch is coming from the master one

git describe --tags --long

is not returning the recently created tag on the release branch, so we're never having the correct version in development.

We find a solution by creating our own provider which doing the same thing than the Git one, but with the shell

git describe --tags $(git rev-list --tags --max-count=1)

Instead of writing a whole similar GitRepositoryProvider I was wondering if an option couldn't be added in order to override the command executed by git. Or maybe there is something to do ? What do you think ?

dontub commented 1 year ago

I think the command to be executed could be added as optional constructor argument. Feel free to make a PR.