Add version number auto-increment support. #129

Open
wants to merge 5 commits into
from

10 participants

@nmeans

'git flow hotfix start' and 'git flow release start' will suggest
a new version number based on previous tags in the respository.
The respective stop commands will suggest the same version number.
Version numbers are in the form [major].[minor].[revision]
(eg. 1.3.5). Any tag matching this form, regardless of text before
or after, will be recognized as a version number and used for
suggesting. 'hotfix' assumes a revision bump and 'release' assumes
a minor bump, but suggestion can be overridden. In addition
'git flow hotfix start 1.0.0' and 'git flow release start 1.0.0'
still work as expected.

Nickolas Means Add version number auto-increment support.
'git flow hotfix start' and 'git flow release start' will suggest
a new version number based on previous tags in the respository.
The respective stop commands will suggest the same version number.
Version numbers are in the form [major].[minor].[revision]
(eg. 1.3.5). 'hotfix' assumes a revision bump and 'release' assumes
a minor bump, but suggestion can be overridden. In addition
'git flow hotfix start 1.0.0' and 'git flow release start 1.0.0'
still work as expected.
fcfecc4
@talios

+1 for this, but somehow make it pluggable. We're using Apache Maven and the version number that should be used is inside a pom.xml file, I keep thinking it'd be nice to automatically pull that out.

Nickolas Means added some commits May 25, 2011
Nickolas Means Sort tags by date. c48e240
Nickolas Means Change tag sort and auto-annotate created tags.
Tag sort is now done by date on the tag, not alpha. This should
ensure we're always looking at the latest tag when incrementing
version number while remaining much simpler than a version sort.

Tags that are created by feature finish and hotfix finish are now
auto-annotated with the version number. This can still be
overridden by adding a -m flag with message to the finish call,
but avoids an unnecessary interruption since the actual tag
message is mostly worthless, but we have to have it to get
author and date metadata.
79d1a15
Nickolas Means Fix a few bugs present in no-tags-present scenario. bba9408
Nickolas Means Get our finish version number guess from branch.
Previous versions attempted to guess version number on finish
based on version number auto-incrementation. It's more intuitive
to guess based on current branch on finish as that honors a user
override of default version number incrementation on release or
hotfix start.
c81941f
@fabn

+1 for this.

@jcftang

+1 for this as well, though I kinda also like the idea of using "epochs" or something like that, there are times when I just want to do regular releases using the year+month+day+hour+min as a version number.

@heeton

+1 Would be really useful at the moment.

@naaman

+1

@jefflai

+1

@we5

+1

@petervanderdoes

@nmeans and everybody else commenting here.
Currently there is a development for implementing action hooks to a number of gitflow commands ( see #185 )

I will create a separate feature that will implement filter hooks, and one of the first hooks I plan to implement is the version. What it means is that a script can be called that allows you to change the version and send a new version back into git flow.

For example somebody does: git flow hotfix start green_lantern
The project dictates the version can not contain _, if the filter script exists it would receive green_lantern, it would remove the underscore and send greenlantern back to git flow.
Another option: git flow hotfix start
An empty string is send to the filter script and at time a new version is produced and send back to git flow.

I'll see what I can whip up.

@asnowfix asnowfix pushed a commit to asnowfix/gitflow that referenced this pull request Apr 23, 2014
@petervanderdoes petervanderdoes Merge branch 'feature/fix_require_version_arg' into develop
Closes #129
b5c0de5
@fspreng

A behavior that is quite similar to the requested one (except optionality of automatically generated version number) is also found for the ITM Gitflow fork.

I'm currently preparing an adequate GitHub presence for the ITM Gitflow script package. Should be ready in a few days, so that you will find details on this feature, as well as on all other improvements, there.

For now, you can find some information on the provided cheat sheet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment