Two-Phase Versioning
If I was being diligent about making the code in every commit "proactively honest" with the version numbering it contains, for projects where the version number lives in the source code rather than getting injected during the build, then:
Right after cutting a release, before committing anything else - unless I already knew that the next commit would be a finished release on its own - I would always make the very next commit contain just an update to the version string to a distinctly "pre-release" or "development" version number.
Later, once I am ready to cut the next release, after I have committed all the other changes that are going into the next release, I would make one final commit with just the change of the version string to the proper release version. That's the commit that would get tagged with the release number.
Repeat.
Basically, I'd be playing two-phase commit with version numbers any time that a release wasn't one atomic commit. A little workflow that precludes any accidental appearance of a released version if you copy or build from a commit between releases.













