callowayproject / bump-my-version

A small command line tool to simplify releasing software by updating all version strings in your source code by the correct increment and optionally commit and tag the changes.
https://callowayproject.github.io/bump-my-version/
MIT License
321 stars 20 forks source link

Version should be bumped to newest version across all git branches #241

Open Lucasje19 opened 2 weeks ago

Lucasje19 commented 2 weeks ago

Description

To make full use of bump-my-version, my team is considering adding some functionality around bump-my-version. Specifically, we'd like a version to be bumped to a newest version across all versions in all branches, no matter the current version in the current branch.

E.g.: a new feature might be developed in branch feature/A, while simultaneously another feature is developed in feature/B. A prerelease candidate from feature/A is bumped to 0.0.1rc0.dev1, but is not finished before feature/B is also needing a bump (generally for testing purposes). feature/B thus needs to be bumped to 0.01rc0.dev2 (in our case). Currently, that is not possible as bump-my-version looks for the most recent git tag with a pattern in the current branch.

Our team is looking into implementing another git command to get the latest possible version tag across all branches, after git fetch --all, namely:

git for-each-ref --format="%(refname)" --sort=-taggerdate --count=1 refs/tags/$(pattern)/v*

and then extracting the version with | sed "s#refs/tags/$(pattern)v##", or with the current commands.

What I Did

Nothing yet. Analyzing and examining possibilities on our own, but also wanting to perhaps contribute to this project if the idea seems reasonable.

What would you make of our request?

coordt commented 1 week ago

I think I understand what you want to do.

The one thing that I've learned from developing and maintaining this tool is that there are so many different workflows. I don't want to remain as neutral to them as possible.

I recommend looking at the new hooks functionality to provide the functionality you want. Then, you can freely tweak it without waiting for a new version of this tool.

Does that make sense? Keep me informed of you things go.