What is a good way of handling version bumps in git history?
The best approach that I've found so far is something like this:
Version is specified in one of the source files (e.g. Python's __version__)
Do not merge PRs unless the also bump the version
All commits against master must also bump version
I block commits against master, and have git hooks/CI checks that parse the version file and compare it to the existing one. I also have a script that creates a branch and automatically bumps the version as a first commit. One weird side effect is that I have to bump the version even for trivial changes (readme), but having an extra patch version doesn't really hurt so I haven't bothered adding ignores to my version checker, even though it would be easy to do.
Generally, this approach works okay, but is there a better way?