Tom Brock
Tom Brock

Reputation: 950

What is actually getting changed when Bump Version is run?

According to http://nvie.com/posts/a-successful-git-branching-model/:

$ git checkout -b release-1.2 develop
Switched to a new branch "release-1.2"
$ ./bump-version.sh 1.2
Files modified successfully, version bumped to 1.2.
$ git commit -a -m "Bumped version number to 1.2"
[release-1.2 74d9424] Bumped version number to 1.2
1 files changed, 1 insertions(+), 1 deletions(-)

After creating a new branch and switching to it, we bump the version number. Here, 
bump-version.sh is a fictional shell script that changes some files in the working 
copy to reflect the new version. (This can of course be a manual change—the point 
being that some files change.) Then, the bumped version number is committed.

But haven't we already named the branch release-1.2, and I assume we would then tag master as 1.2 when we release, so what exactly is ./bump-version.sh 1.2 changing?

Thanks.

Upvotes: 1

Views: 1309

Answers (1)

hashlash
hashlash

Reputation: 1015

First of all, the script in that post is a fictional shell script. So it's just mean that you have to update your files to reflect the new version

After creating a new branch and switching to it, we bump the version number. Here, bump-version.sh is a fictional shell script that changes some files in the working copy to reflect the new version. (This can of course be a manual change—the point being that some files change.) Then, the bumped version number is committed.

The files mentioned above means all files which have version number description on it. Could be readme.md file, or gradle files, or source code with version number hardcoded on it, or anything

The example of this file is django/__init.py file in django repository. So for the next release (suppose they will number it 2.2.0), the file should become something like this

from django.utils.version import get_version

VERSION = (2, 2, 0, 'alpha', 0)

__version__ = get_version(VERSION)

...

EDIT:

related commit example: https://github.com/django/django/commit/92fad87958763a649c698cf28b99ec2c4a2fd109#diff-484b5b08de7d25a106a8855101e2423e

related issue discussion: https://github.com/nvie/gitflow/issues/26

Upvotes: 2

Related Questions