My use case:
dev branch is the main
- feature branches are merged into
dev
- a pull-request from
dev into staging, then staging into prod is done to produce releasable versions
- installable artefacts from
dev, staging and prod are generated by CI and have the version+branch name in the file name
- no 2 distinct commits can have the same version number
- thus version should come from tags plus increment from tag
This action covers most of the needs,:
- major/minor from tag manually set on dev branch
bump_each_commit to automatically ensure requirement 5
I found 2 limitations however:
- the increment includes all the commits, so it grows much too fast. Using
git log --first-parent would solves that
- because the tag is on
dev, the increment on prod, ie. the count of commits from git log ${tag_commit_on_dev} ..${head_commit_on_prod} after the merge dev->prod, goes back in time to include the commits of previous merge operations into prod (which indeed don't exist on dev, so git is correct, but it's not what I want)
So I added 2 features:
- an option to count the increment on
git log --first-parent (keeping also the full increment as it helps comparing the generation of the code between branches)
- a limit on the git log to only include commits since the tag commit (for limitation 2)
Currently my code is unpolished and untested in cases outside my own, but if there were interest, I'd be happy to share it and work on it for inclusion.
Thanks for the useful tool!
My use case:
devbranch is the maindevdevintostaging, thenstagingintoprodis done to produce releasable versionsdev,stagingandprodare generated by CI and have the version+branch name in the file nameThis action covers most of the needs,:
bump_each_committo automatically ensure requirement 5I found 2 limitations however:
git log --first-parentwould solves thatdev, the increment onprod, ie. the count of commits fromgit log ${tag_commit_on_dev} ..${head_commit_on_prod}after the merge dev->prod, goes back in time to include the commits of previous merge operations into prod (which indeed don't exist on dev, so git is correct, but it's not what I want)So I added 2 features:
git log --first-parent(keeping also the full increment as it helps comparing the generation of the code between branches)Currently my code is unpolished and untested in cases outside my own, but if there were interest, I'd be happy to share it and work on it for inclusion.
Thanks for the useful tool!