Feature suggestion: nbgv command to create a release branch
See original GitHub issueFor some of my projects, I use the following branching model in conjunction with Nerdbank.GitVersioning
:
master
always contains the latest development version, releases are built from arelease/vX.Y
branchmaster
is always a prerelease version, so inversion.json
the version is set to e.g.1.2-pre
- When a release branch is created, it is branched off from master and the prerelease tag is removed, while the version of master is increments. So in the above example,
master
would switch to1.3-pre
and a release branchrelease/v1.2
would be created where the version is just1.2
I wrote a small script to automate this process. However, I think this would be useful to be included as a command in the nbgv
tool.
This way, creating a new release would be as simple as running
nbgv create-release
which would
- read the version from
version.json
- create a release branch
- edit and commit new
version.json
on release branch - edit and commit new
version.json
on master branch
Would you be open to include such a feature?
I would be happy to implement it and provide a PR.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:13 (7 by maintainers)
Top Results From Across the Web
Using the nbgv .NET Core CLI tool
The prepare-release command supports this working model by taking care of creating the release branch and updating version.json on both branches.
Read more >Versioning made easier with Nerdbank.GitVersioning
json . Run the command: .\nbgv.exe prepare-release. And it will automatically create the proper release branch and update the ...
Read more >Gitflow release branch process from start to finish example
Use the “git flow release start” command to create the release branch. $ git flow release start 0.1.0 Switched to a new branch...
Read more >Untitled
GitVersioning/nbgv-cli.md at master - GitHub dotnet/Nerdbank. ... GitVersioning - Gitter Feature suggestion: nbgv command to create a release branch …
Read more >Creating a release branch on sprint end
Our setup basically has a master branch: when an issue is created, they branch off master, do the work, create a pull request,...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
At least printing a warning makes sense. We could block it and potentially allow it if
-force
was specified, but we don’t need to go to the trouble of supporting that before folks ask for it.Yes, it can appear in multiple formats. My suggestion would be to simply add/replace the first prerelease identifier using the one specified at the command line. So
-beta
becomes-rc
,-beta.{height}
becomes-rc.{height}
,-beta.{height}.foo
becomes-rc.{height}.foo
.Regarding your scenarios, I’ll assume that all your
vX.Y
branch specs are based on a version.json file with:Since if the
branchName
wasrelease/v{0}
then I presume all your branch name checks would be matching for the new pattern.Regarding the transformation of the version on the
master
branch (or any branch that does not conform to the release branch pattern) as part of the command, I think we should add/change the first identifier of the -prerelease tag to be some constant, as defined by version.json. So the user can specify that any new version should start out as-alpha
or-beta
. So for examples (hint: these should become test cases, encoded as arguments to a[Theory]
. I will assume thatrelease.branchName
=v{0}
andrelease.firstUnstableTag
=-alpha
,release.versionIncrement
=minor
.When run from any branch whose name does not conform to a release branch:
prepare-release
v1.0
-> 1.0prepare-release rc
v1.0
-> 1.0-rcprepare-release
v1.0
-> 1.0prepare-release rc
v1.0
-> 1.0-rc.{height}When run from a release branch, no branch is created, and the following truth table applies:
prepare-release
prepare-release
prepare-release rc
prepare-release rc
From this we see that there are only 2-3 independent variables, that impact different things. So I hope this is a simpler model and simpler to code up than thinking about all the scenarios and their variants that you have listed.
Perhaps what we can do then is have this new command accept an optional parameter that is the new unstable tag. For example, if
master
is building-beta
then theprepare-release rc
command will change-beta
to-rc
in the new branch. This makes the command generally more useful (since stabilization branches might not want to jump directly to building “stable” packages), and it also allows folks who move the git height to some prerelease tag to use the command as well.When the command is invoked on a branch whose name already conforms to the release name convention, instead of branching, it simply changes the prerelease tag. So:
Thoughts?