Did you guys take some time to consider my proposal? Oh well... Ok, I
changed the rssreader project in order to reflect what I'm trying to say. :)

https://github.com/tveronezi/rssreader
https://github.com/tveronezi/rssreader/branches
https://github.com/tveronezi/rssreader/releases

With my proposal, we would have 3, and only 3, branches all the times. In
the example above it goes like this:
* master -> bleeding edge - development branch. I will try to use tomee
2.x.x here.
* with-tomee-1.7.x -> stable branch. Only libraries and TomEE-1.7.x updates
here.
* with-tomee-2.x.x -> stable branch. Updated every time a new TomEE 2.x.x
comes out.

We would also have tags. https://github.com/tveronezi/rssreader/tags
For now I have only one. v1.0 uses the latest released TomEE 1.7.x -> TomEE
1.7.1

Just for one minute, lets imagine/map these branches as being our TomEE
branches:
* master rssreader -> master tomee
* with-tomee-1.7.x -> tomee-1.7.x
* with-tomee-2.x.x -> tomee-2.x.x

My "with-tomee-1.7.x" branch is stable and should not have new features.
Once a new TomEE version comes out, I will simply switch to this branch and
update to the new version. Commit, push, create a new tag (v1.1) and push
the tag. I don't need to touch "master" because "master" uses TomEE
2.0.0-SNAPSHOT.

"with-tomee-2.x.x" is pretty much dead now because we still don't have a
TomEE 2.0.0 release. Once we have it, I will do the following...

tveronezi@sweethome:~/dev/ws/projects/rssreader$ git branch
* master
  with-tomee-1.7.x
  with-tomee-2.x.x

## switching from master to 'with-tomee-2.x.x'

tveronezi@sweethome:~/dev/ws/projects/rssreader$ git checkout
with-tomee-2.x.x
Switched to branch 'with-tomee-2.x.x'

## merging whatever I have in 'master' into 'with-tomee-2.x.x'

tveronezi@sweethome:~/dev/ws/projects/rssreader$ git merge master
Updating 8bbfdcc..64b3095
Fast-forward
 pom.xml |   26 +++++++++++++++++++++++---
 1 file changed, 23 insertions(+), 3 deletions(-)

## pushing it to the remote repository so others can help me

tveronezi@sweethome:~/dev/ws/projects/rssreader$ git push
Total 0 (delta 0), reused 0 (delta 0)
To https://github.com/tveronezi/rssreader.git
   8bbfdcc..64b3095  with-tomee-2.x.x -> with-tomee-2.x.x


## At this point "master" and "with-tomee-2.x.x" are the same. It means
that "with-tomee-2.x.x" could potentially be broken.
## My job now is to make it stable again. Once I did the source changes, I
commit and push them back to the remote branch.
## I also create a tag and push it to the remote repository.
## Commiting the changes I did to make the release possible...

tveronezi@sweethome:~/dev/ws/projects/rssreader$ git status
# On branch with-tomee-2.x.x
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working
directory)
#
# modified:   pom.xml
# modified:   src/main/webapp/index.jsp
#
no changes added to commit (use "git add" and/or "git commit -a")
tveronezi@sweethome:~/dev/ws/projects/rssreader$ git add pom.xml
tveronezi@sweethome:~/dev/ws/projects/rssreader$ git add
src/main/webapp/index.jsp
tveronezi@sweethome:~/dev/ws/projects/rssreader$ git commit -m "not using
extjs webjar due to bug in tomee 2.0.0"
[with-tomee-2.x.x 1562d1a] not using extjs webjar due to bug in tomee 2.0.0
 2 files changed, 3 insertions(+), 9 deletions(-)

tveronezi@sweethome:~/dev/ws/projects/rssreader$ git push
Counting objects: 13, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (7/7), done.
Writing objects: 100% (7/7), 683 bytes, done.
Total 7 (delta 5), reused 0 (delta 0)
To https://github.com/tveronezi/rssreader.git
   64b3095..1562d1a  with-tomee-2.x.x -> with-tomee-2.x.x

## I call a vote. Once it passes, it's time to create a tag.

tveronezi@sweethome:~/dev/ws/projects/rssreader$ git tag -a v2.0-Beta -m
'rssreader with tomee 2.0.0 SNAPSHOT'
tveronezi@sweethome:~/dev/ws/projects/rssreader$ git push origin v2.0-Beta
Counting objects: 1, done.
Writing objects: 100% (1/1), 190 bytes, done.
Total 1 (delta 0), reused 0 (delta 0)
To https://github.com/tveronezi/rssreader.git
 * [new tag]         v2.0-Beta -> v2.0-Beta

## Now it is time to merge our changes back to master so we don't lose our
good work

tveronezi@sweethome:~/dev/ws/projects/rssreader$ git branch
  master
  with-tomee-1.7.x
* with-tomee-2.x.x
tveronezi@sweethome:~/dev/ws/projects/rssreader$ git checkout master
Switched to branch 'master'
tveronezi@sweethome:~/dev/ws/projects/rssreader$ git merge with-tomee-2.x.x
Updating 64b3095..1562d1a
Fast-forward
 pom.xml                   |    8 +-------
 src/main/webapp/index.jsp |    4 ++--
 2 files changed, 3 insertions(+), 9 deletions(-)
tveronezi@sweethome:~/dev/ws/projects/rssreader$ git push
Total 0 (delta 0), reused 0 (delta 0)
To https://github.com/tveronezi/rssreader.git
   64b3095..1562d1a  master -> master


## The release v2.0-Beta is now ready!

This approach makes everyone happy:
* master points to the latest code. So, anyone cloning this project would
automatically have the bleeding edge version of it.
* we don't need to call a code freeze. Other developers can still work on
master.
* we won't need to create and delete new branches.
* there is no "review and commit" process.
* there is no cherry-picking.
* there is no history rewrite.
* we would have release branches that are always (or most of the time)
stable.
* we have tags to our releases


[]s,
Thiago.

Reply via email to